mirror of
https://github.com/NCBM/plyngent.git
synced 2026-07-23 05:55:16 +08:00
core/lmproto: move Responses API into openai package
openai_compatible stays chat-completions-only; OpenAI provider uses lmproto.openai.OpenAIClient.
This commit is contained in:
@@ -3,9 +3,8 @@ from __future__ import annotations
|
||||
import msgspec
|
||||
import pytest
|
||||
|
||||
from plyngent.lmproto.openai_compatible.client import OpenAIClient
|
||||
from plyngent.lmproto.openai_compatible.config import OpenAIConfig
|
||||
from plyngent.lmproto.openai_compatible.responses_model import (
|
||||
from plyngent.lmproto.openai import (
|
||||
OpenAIClient,
|
||||
Response,
|
||||
ResponseDeleted,
|
||||
ResponseFunctionTool,
|
||||
@@ -15,6 +14,7 @@ from plyngent.lmproto.openai_compatible.responses_model import (
|
||||
response_function_calls,
|
||||
response_output_text,
|
||||
)
|
||||
from plyngent.lmproto.openai_compatible.config import OpenAIConfig
|
||||
|
||||
|
||||
def _sample_response_body() -> bytes:
|
||||
|
||||
@@ -9,7 +9,8 @@ from plyngent.config.models import (
|
||||
OpenAIProvider,
|
||||
)
|
||||
from plyngent.lmproto.deepseek import DeepseekOpenAIClient
|
||||
from plyngent.lmproto.openai_compatible import OpenAIClient
|
||||
from plyngent.lmproto.openai import OpenAIClient
|
||||
from plyngent.lmproto.openai_compatible import OpenAICompatibleClient
|
||||
from plyngent.runtime import ProviderNotSupportedError, create_client, provider_to_openai_config
|
||||
|
||||
|
||||
@@ -20,6 +21,7 @@ def test_openai_provider_defaults_base_url() -> None:
|
||||
assert config.base_url == "https://api.openai.com/v1"
|
||||
client = create_client(provider)
|
||||
assert isinstance(client, OpenAIClient)
|
||||
assert hasattr(client, "responses")
|
||||
|
||||
|
||||
def test_openai_compatible_requires_url() -> None:
|
||||
@@ -34,7 +36,8 @@ def test_openai_compatible_client() -> None:
|
||||
url="https://example.com/v1",
|
||||
)
|
||||
client = create_client(provider)
|
||||
assert isinstance(client, OpenAIClient)
|
||||
assert isinstance(client, OpenAICompatibleClient)
|
||||
assert not isinstance(client, OpenAIClient)
|
||||
assert provider_to_openai_config(provider).base_url == "https://example.com/v1"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user