mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-07-31 12:30:30 +08:00
feat: fix types and add reasoning_details to chat responses (#27)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
||||
|
||||
from __future__ import annotations
|
||||
from ._schema3 import Schema3, Schema3TypedDict
|
||||
from .chatstreamingmessagetoolcall import (
|
||||
ChatStreamingMessageToolCall,
|
||||
ChatStreamingMessageToolCallTypedDict,
|
||||
@@ -26,6 +27,7 @@ class ChatStreamingMessageChunkTypedDict(TypedDict):
|
||||
reasoning: NotRequired[Nullable[str]]
|
||||
refusal: NotRequired[Nullable[str]]
|
||||
tool_calls: NotRequired[List[ChatStreamingMessageToolCallTypedDict]]
|
||||
reasoning_details: NotRequired[List[Schema3TypedDict]]
|
||||
|
||||
|
||||
class ChatStreamingMessageChunk(BaseModel):
|
||||
@@ -39,9 +41,18 @@ class ChatStreamingMessageChunk(BaseModel):
|
||||
|
||||
tool_calls: Optional[List[ChatStreamingMessageToolCall]] = None
|
||||
|
||||
reasoning_details: Optional[List[Schema3]] = None
|
||||
|
||||
@model_serializer(mode="wrap")
|
||||
def serialize_model(self, handler):
|
||||
optional_fields = ["role", "content", "reasoning", "refusal", "tool_calls"]
|
||||
optional_fields = [
|
||||
"role",
|
||||
"content",
|
||||
"reasoning",
|
||||
"refusal",
|
||||
"tool_calls",
|
||||
"reasoning_details",
|
||||
]
|
||||
nullable_fields = ["content", "reasoning", "refusal"]
|
||||
null_default_fields = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user