diff --git a/src/openai/types/beta/assistant.py b/src/openai/types/beta/assistant.py index 7a29984b5..7ba50652a 100644 --- a/src/openai/types/beta/assistant.py +++ b/src/openai/types/beta/assistant.py @@ -1,9 +1,10 @@ # File generated from our OpenAPI spec by Stainless. from typing import List, Union, Optional -from typing_extensions import Literal +from typing_extensions import Literal, Annotated from ..shared import FunctionDefinition +from ..._utils import PropertyInfo from ..._models import BaseModel __all__ = ["Assistant", "Tool", "ToolCodeInterpreter", "ToolRetrieval", "ToolFunction"] @@ -26,7 +27,7 @@ class ToolFunction(BaseModel): """The type of tool being defined: `function`""" -Tool = Union[ToolCodeInterpreter, ToolRetrieval, ToolFunction] +Tool = Annotated[Union[ToolCodeInterpreter, ToolRetrieval, ToolFunction], PropertyInfo(discriminator="type")] class Assistant(BaseModel): diff --git a/src/openai/types/beta/threads/message_content_text.py b/src/openai/types/beta/threads/message_content_text.py index b529a384c..dd05ff96c 100644 --- a/src/openai/types/beta/threads/message_content_text.py +++ b/src/openai/types/beta/threads/message_content_text.py @@ -1,8 +1,9 @@ # File generated from our OpenAPI spec by Stainless. from typing import List, Union -from typing_extensions import Literal +from typing_extensions import Literal, Annotated +from ...._utils import PropertyInfo from ...._models import BaseModel __all__ = [ @@ -57,7 +58,9 @@ class TextAnnotationFilePath(BaseModel): """Always `file_path`.""" -TextAnnotation = Union[TextAnnotationFileCitation, TextAnnotationFilePath] +TextAnnotation = Annotated[ + Union[TextAnnotationFileCitation, TextAnnotationFilePath], PropertyInfo(discriminator="type") +] class Text(BaseModel): diff --git a/src/openai/types/beta/threads/runs/code_tool_call.py b/src/openai/types/beta/threads/runs/code_tool_call.py index f808005ec..0de47b379 100644 --- a/src/openai/types/beta/threads/runs/code_tool_call.py +++ b/src/openai/types/beta/threads/runs/code_tool_call.py @@ -1,8 +1,9 @@ # File generated from our OpenAPI spec by Stainless. from typing import List, Union -from typing_extensions import Literal +from typing_extensions import Literal, Annotated +from ....._utils import PropertyInfo from ....._models import BaseModel __all__ = [ @@ -38,7 +39,9 @@ class CodeInterpreterOutputImage(BaseModel): """Always `image`.""" -CodeInterpreterOutput = Union[CodeInterpreterOutputLogs, CodeInterpreterOutputImage] +CodeInterpreterOutput = Annotated[ + Union[CodeInterpreterOutputLogs, CodeInterpreterOutputImage], PropertyInfo(discriminator="type") +] class CodeInterpreter(BaseModel): diff --git a/src/openai/types/beta/threads/runs/run_step.py b/src/openai/types/beta/threads/runs/run_step.py index 01aab8e9a..899883ac2 100644 --- a/src/openai/types/beta/threads/runs/run_step.py +++ b/src/openai/types/beta/threads/runs/run_step.py @@ -1,8 +1,9 @@ # File generated from our OpenAPI spec by Stainless. from typing import Union, Optional -from typing_extensions import Literal +from typing_extensions import Literal, Annotated +from ....._utils import PropertyInfo from ....._models import BaseModel from .tool_calls_step_details import ToolCallsStepDetails from .message_creation_step_details import MessageCreationStepDetails @@ -18,7 +19,7 @@ class LastError(BaseModel): """A human-readable description of the error.""" -StepDetails = Union[MessageCreationStepDetails, ToolCallsStepDetails] +StepDetails = Annotated[Union[MessageCreationStepDetails, ToolCallsStepDetails], PropertyInfo(discriminator="type")] class Usage(BaseModel): diff --git a/src/openai/types/beta/threads/runs/tool_calls_step_details.py b/src/openai/types/beta/threads/runs/tool_calls_step_details.py index 80eb90bf6..b1b5a72be 100644 --- a/src/openai/types/beta/threads/runs/tool_calls_step_details.py +++ b/src/openai/types/beta/threads/runs/tool_calls_step_details.py @@ -1,8 +1,9 @@ # File generated from our OpenAPI spec by Stainless. from typing import List, Union -from typing_extensions import Literal +from typing_extensions import Literal, Annotated +from ....._utils import PropertyInfo from ....._models import BaseModel from .code_tool_call import CodeToolCall from .function_tool_call import FunctionToolCall @@ -10,7 +11,7 @@ __all__ = ["ToolCallsStepDetails", "ToolCall"] -ToolCall = Union[CodeToolCall, RetrievalToolCall, FunctionToolCall] +ToolCall = Annotated[Union[CodeToolCall, RetrievalToolCall, FunctionToolCall], PropertyInfo(discriminator="type")] class ToolCallsStepDetails(BaseModel): diff --git a/src/openai/types/beta/threads/thread_message.py b/src/openai/types/beta/threads/thread_message.py index 25b3a199f..6ed5da140 100644 --- a/src/openai/types/beta/threads/thread_message.py +++ b/src/openai/types/beta/threads/thread_message.py @@ -1,15 +1,16 @@ # File generated from our OpenAPI spec by Stainless. from typing import List, Union, Optional -from typing_extensions import Literal +from typing_extensions import Literal, Annotated +from ...._utils import PropertyInfo from ...._models import BaseModel from .message_content_text import MessageContentText from .message_content_image_file import MessageContentImageFile __all__ = ["ThreadMessage", "Content"] -Content = Union[MessageContentImageFile, MessageContentText] +Content = Annotated[Union[MessageContentImageFile, MessageContentText], PropertyInfo(discriminator="type")] class ThreadMessage(BaseModel):