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:
2026-07-15 20:52:17 +08:00
parent 3e20b1559c
commit 38edc09854
9 changed files with 180 additions and 94 deletions
+3 -3
View File
@@ -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:
+5 -2
View File
@@ -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"