diff --git a/src/plyngent/agent/types.py b/src/plyngent/agent/types.py new file mode 100644 index 0000000..d589f9f --- /dev/null +++ b/src/plyngent/agent/types.py @@ -0,0 +1,10 @@ +"""Agent-level type aliases for LLM client dispatch.""" + +from __future__ import annotations + +from plyngent.lmproto.anthropic.client import AnthropicClient +from plyngent.lmproto.deepseek.openai_compat.client import DeepseekOpenAIClient +from plyngent.lmproto.openai.client import OpenAIClient +from plyngent.lmproto.openai_compatible.client import OpenAICompatibleClient + +type AnyLLMClient = OpenAICompatibleClient | DeepseekOpenAIClient | OpenAIClient | AnthropicClient diff --git a/src/plyngent/lmproto/deepseek/openai_compat/client.py b/src/plyngent/lmproto/deepseek/openai_compat/client.py index a195a51..dce1692 100644 --- a/src/plyngent/lmproto/deepseek/openai_compat/client.py +++ b/src/plyngent/lmproto/deepseek/openai_compat/client.py @@ -30,6 +30,8 @@ def _inject_thinking(data: bytes) -> bytes: class DeepseekOpenAIClient(BaseOpenAIClient): + kind: str = "chat_completions" + def __init__(self, config: OpenAIConfig) -> None: super().__init__(config) diff --git a/src/plyngent/lmproto/openai/client.py b/src/plyngent/lmproto/openai/client.py index 9b80296..40608a2 100644 --- a/src/plyngent/lmproto/openai/client.py +++ b/src/plyngent/lmproto/openai/client.py @@ -23,6 +23,8 @@ if TYPE_CHECKING: class OpenAIClient(BaseOpenAIClient): """Full OpenAI HTTP client (``/chat/completions`` + ``/responses`` + ``/models``).""" + kind: str = "responses" + response_decoder: msgspec.json.Decoder[Response] response_deleted_decoder: msgspec.json.Decoder[ResponseDeleted] response_event_decoder: msgspec.json.Decoder[ResponseStreamEvent] diff --git a/src/plyngent/lmproto/openai_compatible/client.py b/src/plyngent/lmproto/openai_compatible/client.py index 257e175..328e31a 100644 --- a/src/plyngent/lmproto/openai_compatible/client.py +++ b/src/plyngent/lmproto/openai_compatible/client.py @@ -180,6 +180,8 @@ class BaseOpenAIClient: class OpenAICompatibleClient(BaseOpenAIClient): """Chat Completions only (``POST /chat/completions`` + ``GET /models``).""" + kind: str = "chat_completions" + def __init__(self, config: OpenAIConfig) -> None: super().__init__(config)