From 736c9e5ac4f79a1b0e29c16d6bcc89eadc5ff230 Mon Sep 17 00:00:00 2001 From: Wang ChengMeng <79295644+cmw-creator@users.noreply.github.com> Date: Sat, 6 Jun 2026 12:38:57 +0000 Subject: [PATCH] fix: nest model_id/provider_id under model key in SessionChatParams --- src/opencode_ai/types/session_chat_params.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/opencode_ai/types/session_chat_params.py b/src/opencode_ai/types/session_chat_params.py index e827282..10f4bcd 100644 --- a/src/opencode_ai/types/session_chat_params.py +++ b/src/opencode_ai/types/session_chat_params.py @@ -9,16 +9,22 @@ from .._utils import PropertyInfo from .file_part_input_param import FilePartInputParam from .text_part_input_param import TextPartInputParam -__all__ = ["SessionChatParams", "Part"] +__all__ = ["ModelParam", "SessionChatParams", "Part"] + + +class ModelParam(TypedDict, total=False): + """Model selection parameters nested under the ``model`` key.""" + + model_id: Required[Annotated[str, PropertyInfo(alias="modelID")]] + + provider_id: Required[Annotated[str, PropertyInfo(alias="providerID")]] class SessionChatParams(TypedDict, total=False): - model_id: Required[Annotated[str, PropertyInfo(alias="modelID")]] + model: Required[ModelParam] parts: Required[Iterable[Part]] - provider_id: Required[Annotated[str, PropertyInfo(alias="providerID")]] - message_id: Annotated[str, PropertyInfo(alias="messageID")] mode: str