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
Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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,
Lines changed: 4 additions & 2 deletions
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+
]
Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 1 deletion
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]

0 commit comments

Comments
 (0)