Skip to content

Commit 5907ea0

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
chore(internal): use TypeAlias marker for type assignments (#1597)
1 parent da48e4c commit 5907ea0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+99
-80
lines changed
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing_extensions import Literal
3+
from typing_extensions import Literal, TypeAlias
44

55
__all__ = ["SpeechModel"]
66

7-
SpeechModel = Literal["tts-1", "tts-1-hd"]
7+
SpeechModel: TypeAlias = Literal["tts-1", "tts-1-hd"]

src/openai/types/audio_model.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing_extensions import Literal
3+
from typing_extensions import Literal, TypeAlias
44

55
__all__ = ["AudioModel"]
66

7-
AudioModel = Literal["whisper-1"]
7+
AudioModel: TypeAlias = Literal["whisper-1"]

src/openai/types/beta/assistant_create_params.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from __future__ import annotations
44

55
from typing import List, Union, Iterable, Optional
6-
from typing_extensions import Literal, Required, TypedDict
6+
from typing_extensions import Literal, Required, TypeAlias, TypedDict
77

88
from ..chat_model import ChatModel
99
from .assistant_tool_param import AssistantToolParam
@@ -140,7 +140,7 @@ class ToolResourcesFileSearchVectorStoreChunkingStrategyStatic(TypedDict, total=
140140
"""Always `static`."""
141141

142142

143-
ToolResourcesFileSearchVectorStoreChunkingStrategy = Union[
143+
ToolResourcesFileSearchVectorStoreChunkingStrategy: TypeAlias = Union[
144144
ToolResourcesFileSearchVectorStoreChunkingStrategyAuto, ToolResourcesFileSearchVectorStoreChunkingStrategyStatic
145145
]
146146

Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
from typing import Union
4-
from typing_extensions import Literal
4+
from typing_extensions import Literal, TypeAlias
55

66
from .assistant_response_format import AssistantResponseFormat
77

88
__all__ = ["AssistantResponseFormatOption"]
99

10-
AssistantResponseFormatOption = Union[Literal["none", "auto"], AssistantResponseFormat]
10+
AssistantResponseFormatOption: TypeAlias = Union[Literal["none", "auto"], AssistantResponseFormat]

src/openai/types/beta/assistant_response_format_option_param.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
from __future__ import annotations
44

55
from typing import Union
6-
from typing_extensions import Literal
6+
from typing_extensions import Literal, TypeAlias
77

88
from .assistant_response_format_param import AssistantResponseFormatParam
99

1010
__all__ = ["AssistantResponseFormatOptionParam"]
1111

12-
AssistantResponseFormatOptionParam = Union[Literal["none", "auto"], AssistantResponseFormatParam]
12+
AssistantResponseFormatOptionParam: TypeAlias = Union[Literal["none", "auto"], AssistantResponseFormatParam]

src/openai/types/beta/assistant_stream_event.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
from typing import Union
4-
from typing_extensions import Literal, Annotated
4+
from typing_extensions import Literal, Annotated, TypeAlias
55

66
from .thread import Thread
77
from ..._utils import PropertyInfo
@@ -260,7 +260,7 @@ class ErrorEvent(BaseModel):
260260
event: Literal["error"]
261261

262262

263-
AssistantStreamEvent = Annotated[
263+
AssistantStreamEvent: TypeAlias = Annotated[
264264
Union[
265265
ThreadCreated,
266266
ThreadRunCreated,
+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
from typing import Union
4-
from typing_extensions import Annotated
4+
from typing_extensions import Annotated, TypeAlias
55

66
from ..._utils import PropertyInfo
77
from .function_tool import FunctionTool
@@ -10,4 +10,6 @@
1010

1111
__all__ = ["AssistantTool"]
1212

13-
AssistantTool = Annotated[Union[CodeInterpreterTool, FileSearchTool, FunctionTool], PropertyInfo(discriminator="type")]
13+
AssistantTool: TypeAlias = Annotated[
14+
Union[CodeInterpreterTool, FileSearchTool, FunctionTool], PropertyInfo(discriminator="type")
15+
]
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
from typing import Union
4-
from typing_extensions import Literal
4+
from typing_extensions import Literal, TypeAlias
55

66
from .assistant_tool_choice import AssistantToolChoice
77

88
__all__ = ["AssistantToolChoiceOption"]
99

10-
AssistantToolChoiceOption = Union[Literal["none", "auto", "required"], AssistantToolChoice]
10+
AssistantToolChoiceOption: TypeAlias = Union[Literal["none", "auto", "required"], AssistantToolChoice]

src/openai/types/beta/assistant_tool_choice_option_param.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
from __future__ import annotations
44

55
from typing import Union
6-
from typing_extensions import Literal
6+
from typing_extensions import Literal, TypeAlias
77

88
from .assistant_tool_choice_param import AssistantToolChoiceParam
99

1010
__all__ = ["AssistantToolChoiceOptionParam"]
1111

12-
AssistantToolChoiceOptionParam = Union[Literal["none", "auto", "required"], AssistantToolChoiceParam]
12+
AssistantToolChoiceOptionParam: TypeAlias = Union[Literal["none", "auto", "required"], AssistantToolChoiceParam]

src/openai/types/beta/assistant_tool_param.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
from __future__ import annotations
44

55
from typing import Union
6+
from typing_extensions import TypeAlias
67

78
from .function_tool_param import FunctionToolParam
89
from .file_search_tool_param import FileSearchToolParam
910
from .code_interpreter_tool_param import CodeInterpreterToolParam
1011

1112
__all__ = ["AssistantToolParam"]
1213

13-
AssistantToolParam = Union[CodeInterpreterToolParam, FileSearchToolParam, FunctionToolParam]
14+
AssistantToolParam: TypeAlias = Union[CodeInterpreterToolParam, FileSearchToolParam, FunctionToolParam]

src/openai/types/beta/thread_create_and_run_params.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from __future__ import annotations
44

55
from typing import List, Union, Iterable, Optional
6-
from typing_extensions import Literal, Required, TypedDict
6+
from typing_extensions import Literal, Required, TypeAlias, TypedDict
77

88
from ..chat_model import ChatModel
99
from .function_tool_param import FunctionToolParam
@@ -168,7 +168,7 @@ class ThreadMessageAttachmentToolFileSearch(TypedDict, total=False):
168168
"""The type of tool being defined: `file_search`"""
169169

170170

171-
ThreadMessageAttachmentTool = Union[CodeInterpreterToolParam, ThreadMessageAttachmentToolFileSearch]
171+
ThreadMessageAttachmentTool: TypeAlias = Union[CodeInterpreterToolParam, ThreadMessageAttachmentToolFileSearch]
172172

173173

174174
class ThreadMessageAttachment(TypedDict, total=False):
@@ -240,7 +240,7 @@ class ThreadToolResourcesFileSearchVectorStoreChunkingStrategyStatic(TypedDict,
240240
"""Always `static`."""
241241

242242

243-
ThreadToolResourcesFileSearchVectorStoreChunkingStrategy = Union[
243+
ThreadToolResourcesFileSearchVectorStoreChunkingStrategy: TypeAlias = Union[
244244
ThreadToolResourcesFileSearchVectorStoreChunkingStrategyAuto,
245245
ThreadToolResourcesFileSearchVectorStoreChunkingStrategyStatic,
246246
]
@@ -342,7 +342,7 @@ class ToolResources(TypedDict, total=False):
342342
file_search: ToolResourcesFileSearch
343343

344344

345-
Tool = Union[CodeInterpreterToolParam, FileSearchToolParam, FunctionToolParam]
345+
Tool: TypeAlias = Union[CodeInterpreterToolParam, FileSearchToolParam, FunctionToolParam]
346346

347347

348348
class TruncationStrategy(TypedDict, total=False):

src/openai/types/beta/thread_create_params.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from __future__ import annotations
44

55
from typing import List, Union, Iterable, Optional
6-
from typing_extensions import Literal, Required, TypedDict
6+
from typing_extensions import Literal, Required, TypeAlias, TypedDict
77

88
from .code_interpreter_tool_param import CodeInterpreterToolParam
99
from .threads.message_content_part_param import MessageContentPartParam
@@ -54,7 +54,7 @@ class MessageAttachmentToolFileSearch(TypedDict, total=False):
5454
"""The type of tool being defined: `file_search`"""
5555

5656

57-
MessageAttachmentTool = Union[CodeInterpreterToolParam, MessageAttachmentToolFileSearch]
57+
MessageAttachmentTool: TypeAlias = Union[CodeInterpreterToolParam, MessageAttachmentToolFileSearch]
5858

5959

6060
class MessageAttachment(TypedDict, total=False):
@@ -126,7 +126,7 @@ class ToolResourcesFileSearchVectorStoreChunkingStrategyStatic(TypedDict, total=
126126
"""Always `static`."""
127127

128128

129-
ToolResourcesFileSearchVectorStoreChunkingStrategy = Union[
129+
ToolResourcesFileSearchVectorStoreChunkingStrategy: TypeAlias = Union[
130130
ToolResourcesFileSearchVectorStoreChunkingStrategyAuto, ToolResourcesFileSearchVectorStoreChunkingStrategyStatic
131131
]
132132

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
from typing import Union
4-
from typing_extensions import Annotated
4+
from typing_extensions import Annotated, TypeAlias
55

66
from ...._utils import PropertyInfo
77
from .file_path_annotation import FilePathAnnotation
88
from .file_citation_annotation import FileCitationAnnotation
99

1010
__all__ = ["Annotation"]
1111

12-
Annotation = Annotated[Union[FileCitationAnnotation, FilePathAnnotation], PropertyInfo(discriminator="type")]
12+
Annotation: TypeAlias = Annotated[Union[FileCitationAnnotation, FilePathAnnotation], PropertyInfo(discriminator="type")]
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
from typing import Union
4-
from typing_extensions import Annotated
4+
from typing_extensions import Annotated, TypeAlias
55

66
from ...._utils import PropertyInfo
77
from .file_path_delta_annotation import FilePathDeltaAnnotation
88
from .file_citation_delta_annotation import FileCitationDeltaAnnotation
99

1010
__all__ = ["AnnotationDelta"]
1111

12-
AnnotationDelta = Annotated[
12+
AnnotationDelta: TypeAlias = Annotated[
1313
Union[FileCitationDeltaAnnotation, FilePathDeltaAnnotation], PropertyInfo(discriminator="type")
1414
]

src/openai/types/beta/threads/message.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
from typing import List, Union, Optional
4-
from typing_extensions import Literal
4+
from typing_extensions import Literal, TypeAlias
55

66
from ...._models import BaseModel
77
from .message_content import MessageContent
@@ -21,7 +21,7 @@ class AttachmentToolAssistantToolsFileSearchTypeOnly(BaseModel):
2121
"""The type of tool being defined: `file_search`"""
2222

2323

24-
AttachmentTool = Union[CodeInterpreterTool, AttachmentToolAssistantToolsFileSearchTypeOnly]
24+
AttachmentTool: TypeAlias = Union[CodeInterpreterTool, AttachmentToolAssistantToolsFileSearchTypeOnly]
2525

2626

2727
class Attachment(BaseModel):
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
from typing import Union
4-
from typing_extensions import Annotated
4+
from typing_extensions import Annotated, TypeAlias
55

66
from ...._utils import PropertyInfo
77
from .text_content_block import TextContentBlock
@@ -10,6 +10,6 @@
1010

1111
__all__ = ["MessageContent"]
1212

13-
MessageContent = Annotated[
13+
MessageContent: TypeAlias = Annotated[
1414
Union[ImageFileContentBlock, ImageURLContentBlock, TextContentBlock], PropertyInfo(discriminator="type")
1515
]
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
from typing import Union
4-
from typing_extensions import Annotated
4+
from typing_extensions import Annotated, TypeAlias
55

66
from ...._utils import PropertyInfo
77
from .text_delta_block import TextDeltaBlock
@@ -10,6 +10,6 @@
1010

1111
__all__ = ["MessageContentDelta"]
1212

13-
MessageContentDelta = Annotated[
13+
MessageContentDelta: TypeAlias = Annotated[
1414
Union[ImageFileDeltaBlock, TextDeltaBlock, ImageURLDeltaBlock], PropertyInfo(discriminator="type")
1515
]

src/openai/types/beta/threads/message_content_part_param.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
from __future__ import annotations
44

55
from typing import Union
6+
from typing_extensions import TypeAlias
67

78
from .text_content_block_param import TextContentBlockParam
89
from .image_url_content_block_param import ImageURLContentBlockParam
910
from .image_file_content_block_param import ImageFileContentBlockParam
1011

1112
__all__ = ["MessageContentPartParam"]
1213

13-
MessageContentPartParam = Union[ImageFileContentBlockParam, ImageURLContentBlockParam, TextContentBlockParam]
14+
MessageContentPartParam: TypeAlias = Union[ImageFileContentBlockParam, ImageURLContentBlockParam, TextContentBlockParam]

src/openai/types/beta/threads/message_create_params.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from __future__ import annotations
44

55
from typing import Union, Iterable, Optional
6-
from typing_extensions import Literal, Required, TypedDict
6+
from typing_extensions import Literal, Required, TypeAlias, TypedDict
77

88
from .message_content_part_param import MessageContentPartParam
99
from ..code_interpreter_tool_param import CodeInterpreterToolParam
@@ -41,7 +41,7 @@ class AttachmentToolFileSearch(TypedDict, total=False):
4141
"""The type of tool being defined: `file_search`"""
4242

4343

44-
AttachmentTool = Union[CodeInterpreterToolParam, AttachmentToolFileSearch]
44+
AttachmentTool: TypeAlias = Union[CodeInterpreterToolParam, AttachmentToolFileSearch]
4545

4646

4747
class Attachment(TypedDict, total=False):

src/openai/types/beta/threads/run_create_params.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from __future__ import annotations
44

55
from typing import Union, Iterable, Optional
6-
from typing_extensions import Literal, Required, TypedDict
6+
from typing_extensions import Literal, Required, TypeAlias, TypedDict
77

88
from ...chat_model import ChatModel
99
from ..assistant_tool_param import AssistantToolParam
@@ -154,7 +154,7 @@ class AdditionalMessageAttachmentToolFileSearch(TypedDict, total=False):
154154
"""The type of tool being defined: `file_search`"""
155155

156156

157-
AdditionalMessageAttachmentTool = Union[CodeInterpreterToolParam, AdditionalMessageAttachmentToolFileSearch]
157+
AdditionalMessageAttachmentTool: TypeAlias = Union[CodeInterpreterToolParam, AdditionalMessageAttachmentToolFileSearch]
158158

159159

160160
class AdditionalMessageAttachment(TypedDict, total=False):

src/openai/types/beta/threads/run_status.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing_extensions import Literal
3+
from typing_extensions import Literal, TypeAlias
44

55
__all__ = ["RunStatus"]
66

7-
RunStatus = Literal[
7+
RunStatus: TypeAlias = Literal[
88
"queued",
99
"in_progress",
1010
"requires_action",

src/openai/types/beta/threads/runs/code_interpreter_tool_call.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
from typing import List, Union
4-
from typing_extensions import Literal, Annotated
4+
from typing_extensions import Literal, Annotated, TypeAlias
55

66
from ....._utils import PropertyInfo
77
from ....._models import BaseModel
@@ -39,7 +39,7 @@ class CodeInterpreterOutputImage(BaseModel):
3939
"""Always `image`."""
4040

4141

42-
CodeInterpreterOutput = Annotated[
42+
CodeInterpreterOutput: TypeAlias = Annotated[
4343
Union[CodeInterpreterOutputLogs, CodeInterpreterOutputImage], PropertyInfo(discriminator="type")
4444
]
4545

src/openai/types/beta/threads/runs/code_interpreter_tool_call_delta.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
from typing import List, Union, Optional
4-
from typing_extensions import Literal, Annotated
4+
from typing_extensions import Literal, Annotated, TypeAlias
55

66
from ....._utils import PropertyInfo
77
from ....._models import BaseModel
@@ -10,7 +10,7 @@
1010

1111
__all__ = ["CodeInterpreterToolCallDelta", "CodeInterpreter", "CodeInterpreterOutput"]
1212

13-
CodeInterpreterOutput = Annotated[
13+
CodeInterpreterOutput: TypeAlias = Annotated[
1414
Union[CodeInterpreterLogs, CodeInterpreterOutputImage], PropertyInfo(discriminator="type")
1515
]
1616

0 commit comments

Comments
 (0)