feat: fix types and add reasoning_details to chat responses (#27)

This commit is contained in:
Matt Apperson
2025-12-16 16:16:22 -05:00
committed by GitHub
parent d433ce35e8
commit f190e3f950
81 changed files with 2249 additions and 1133 deletions
@@ -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 = []