Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a4bff9c

Browse files
stainless-app[bot]stainless-bot
authored andcommittedAug 5, 2024·
chore(internal): use TypeAlias marker for type assignments (#621)
1 parent 0a3f3fa commit a4bff9c

9 files changed

+18
-18
lines changed
 

‎src/anthropic/types/content_block.py

+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 .text_block import TextBlock
88
from .tool_use_block import ToolUseBlock
99

1010
__all__ = ["ContentBlock"]
1111

12-
ContentBlock = Annotated[Union[TextBlock, ToolUseBlock], PropertyInfo(discriminator="type")]
12+
ContentBlock: TypeAlias = Annotated[Union[TextBlock, ToolUseBlock], PropertyInfo(discriminator="type")]

‎src/anthropic/types/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 List, Union, Iterable, Optional
6-
from typing_extensions import Literal, Required, TypedDict
6+
from typing_extensions import Literal, Required, TypeAlias, TypedDict
77

88
from .tool_param import ToolParam
99
from .model_param import ModelParam
@@ -287,7 +287,7 @@ class ToolChoiceToolChoiceTool(TypedDict, total=False):
287287
type: Required[Literal["tool"]]
288288

289289

290-
ToolChoice = Union[ToolChoiceToolChoiceAuto, ToolChoiceToolChoiceAny, ToolChoiceToolChoiceTool]
290+
ToolChoice: TypeAlias = Union[ToolChoiceToolChoiceAuto, ToolChoiceToolChoiceAny, ToolChoiceToolChoiceTool]
291291

292292

293293
class MessageCreateParamsNonStreaming(MessageCreateParamsBase):

‎src/anthropic/types/model.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
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
__all__ = ["Model"]
77

8-
Model = Union[
8+
Model: TypeAlias = Union[
99
str,
1010
Literal[
1111
"claude-3-5-sonnet-20240620",

‎src/anthropic/types/model_param.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
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
__all__ = ["ModelParam"]
99

10-
ModelParam = Union[
10+
ModelParam: TypeAlias = Union[
1111
str,
1212
Literal[
1313
"claude-3-5-sonnet-20240620",

‎src/anthropic/types/raw_content_block_delta_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 .._utils import PropertyInfo
77
from .._models import BaseModel
@@ -10,7 +10,7 @@
1010

1111
__all__ = ["RawContentBlockDeltaEvent", "Delta"]
1212

13-
Delta = Annotated[Union[TextDelta, InputJSONDelta], PropertyInfo(discriminator="type")]
13+
Delta: TypeAlias = Annotated[Union[TextDelta, InputJSONDelta], PropertyInfo(discriminator="type")]
1414

1515

1616
class RawContentBlockDeltaEvent(BaseModel):

‎src/anthropic/types/raw_content_block_start_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 .._utils import PropertyInfo
77
from .._models import BaseModel
@@ -10,7 +10,7 @@
1010

1111
__all__ = ["RawContentBlockStartEvent", "ContentBlock"]
1212

13-
ContentBlock = Annotated[Union[TextBlock, ToolUseBlock], PropertyInfo(discriminator="type")]
13+
ContentBlock: TypeAlias = Annotated[Union[TextBlock, ToolUseBlock], PropertyInfo(discriminator="type")]
1414

1515

1616
class RawContentBlockStartEvent(BaseModel):

‎src/anthropic/types/raw_message_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 Annotated
4+
from typing_extensions import Annotated, TypeAlias
55

66
from .._utils import PropertyInfo
77
from .raw_message_stop_event import RawMessageStopEvent
@@ -13,7 +13,7 @@
1313

1414
__all__ = ["RawMessageStreamEvent"]
1515

16-
RawMessageStreamEvent = Annotated[
16+
RawMessageStreamEvent: TypeAlias = Annotated[
1717
Union[
1818
RawMessageStartEvent,
1919
RawMessageDeltaEvent,

‎src/anthropic/types/tool_param.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 Dict, Union, Optional
6-
from typing_extensions import Literal, Required, TypedDict
6+
from typing_extensions import Literal, Required, TypeAlias, TypedDict
77

88
__all__ = ["ToolParam", "InputSchema"]
99

@@ -14,7 +14,7 @@ class InputSchemaTyped(TypedDict, total=False):
1414
properties: Optional[object]
1515

1616

17-
InputSchema = Union[InputSchemaTyped, Dict[str, object]]
17+
InputSchema: TypeAlias = Union[InputSchemaTyped, Dict[str, object]]
1818

1919

2020
class ToolParam(TypedDict, total=False):

‎src/anthropic/types/tool_result_block_param.py

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

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

88
from .text_block_param import TextBlockParam
99
from .image_block_param import ImageBlockParam
1010

1111
__all__ = ["ToolResultBlockParam", "Content"]
1212

13-
Content = Union[TextBlockParam, ImageBlockParam]
13+
Content: TypeAlias = Union[TextBlockParam, ImageBlockParam]
1414

1515

1616
class ToolResultBlockParam(TypedDict, total=False):

0 commit comments

Comments
 (0)
Please sign in to comment.