mirror of
https://github.com/anomalyco/opencode-sdk-python.git
synced 2026-07-26 17:35:43 +00:00
Merge 4d9d2db328 into 817f1a0816
This commit is contained in:
commit
2db8df8100
3 changed files with 28 additions and 15 deletions
|
|
@ -192,9 +192,11 @@ class SessionResource(SyncAPIResource):
|
|||
f"/session/{id}/message",
|
||||
body=maybe_transform(
|
||||
{
|
||||
"model_id": model_id,
|
||||
"model": {
|
||||
"model_id": model_id,
|
||||
"provider_id": provider_id,
|
||||
},
|
||||
"parts": parts,
|
||||
"provider_id": provider_id,
|
||||
"message_id": message_id,
|
||||
"mode": mode,
|
||||
"system": system,
|
||||
|
|
@ -243,8 +245,10 @@ class SessionResource(SyncAPIResource):
|
|||
body=maybe_transform(
|
||||
{
|
||||
"message_id": message_id,
|
||||
"model_id": model_id,
|
||||
"provider_id": provider_id,
|
||||
"model": {
|
||||
"model_id": model_id,
|
||||
"provider_id": provider_id,
|
||||
},
|
||||
},
|
||||
session_init_params.SessionInitParams,
|
||||
),
|
||||
|
|
@ -637,9 +641,11 @@ class AsyncSessionResource(AsyncAPIResource):
|
|||
f"/session/{id}/message",
|
||||
body=await async_maybe_transform(
|
||||
{
|
||||
"model_id": model_id,
|
||||
"model": {
|
||||
"model_id": model_id,
|
||||
"provider_id": provider_id,
|
||||
},
|
||||
"parts": parts,
|
||||
"provider_id": provider_id,
|
||||
"message_id": message_id,
|
||||
"mode": mode,
|
||||
"system": system,
|
||||
|
|
@ -688,8 +694,10 @@ class AsyncSessionResource(AsyncAPIResource):
|
|||
body=await async_maybe_transform(
|
||||
{
|
||||
"message_id": message_id,
|
||||
"model_id": model_id,
|
||||
"provider_id": provider_id,
|
||||
"model": {
|
||||
"model_id": model_id,
|
||||
"provider_id": provider_id,
|
||||
},
|
||||
},
|
||||
session_init_params.SessionInitParams,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ from __future__ import annotations
|
|||
from typing_extensions import Required, Annotated, TypedDict
|
||||
|
||||
from .._utils import PropertyInfo
|
||||
from .session_chat_params import ModelParam
|
||||
|
||||
__all__ = ["SessionInitParams"]
|
||||
|
||||
|
|
@ -12,6 +13,4 @@ __all__ = ["SessionInitParams"]
|
|||
class SessionInitParams(TypedDict, total=False):
|
||||
message_id: Required[Annotated[str, PropertyInfo(alias="messageID")]]
|
||||
|
||||
model_id: Required[Annotated[str, PropertyInfo(alias="modelID")]]
|
||||
|
||||
provider_id: Required[Annotated[str, PropertyInfo(alias="providerID")]]
|
||||
model: Required[ModelParam]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue