Skip to content

Commit 530f9b8

Browse files
chore: move ChatModel type to shared (#2167)
1 parent dfc4cfa commit 530f9b8

15 files changed

+116
-54
lines changed

api.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
```python
44
from openai.types import (
5+
ChatModel,
56
ErrorObject,
67
FunctionDefinition,
78
FunctionParameters,
@@ -222,9 +223,9 @@ Types:
222223
from openai.types.fine_tuning import (
223224
FineTuningJob,
224225
FineTuningJobEvent,
225-
FineTuningJobIntegration,
226226
FineTuningJobWandbIntegration,
227227
FineTuningJobWandbIntegrationObject,
228+
FineTuningJobIntegration,
228229
)
229230
```
230231

src/openai/resources/beta/assistants.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
assistant_update_params,
2424
)
2525
from ..._base_client import AsyncPaginator, make_request_options
26-
from ...types.chat_model import ChatModel
2726
from ...types.beta.assistant import Assistant
27+
from ...types.shared.chat_model import ChatModel
2828
from ...types.beta.assistant_deleted import AssistantDeleted
2929
from ...types.shared_params.metadata import Metadata
3030
from ...types.beta.assistant_tool_param import AssistantToolParam

src/openai/resources/beta/threads/runs/runs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@
3939
AsyncAssistantEventHandlerT,
4040
AsyncAssistantStreamManager,
4141
)
42-
from .....types.chat_model import ChatModel
4342
from .....types.beta.threads import (
4443
run_list_params,
4544
run_create_params,
4645
run_update_params,
4746
run_submit_tool_outputs_params,
4847
)
4948
from .....types.beta.threads.run import Run
49+
from .....types.shared.chat_model import ChatModel
5050
from .....types.shared_params.metadata import Metadata
5151
from .....types.beta.assistant_tool_param import AssistantToolParam
5252
from .....types.beta.assistant_stream_event import AssistantStreamEvent

src/openai/resources/beta/threads/threads.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@
4949
AsyncAssistantEventHandlerT,
5050
AsyncAssistantStreamManager,
5151
)
52-
from ....types.chat_model import ChatModel
5352
from ....types.beta.thread import Thread
5453
from ....types.beta.threads.run import Run
54+
from ....types.shared.chat_model import ChatModel
5555
from ....types.beta.thread_deleted import ThreadDeleted
5656
from ....types.shared_params.metadata import Metadata
5757
from ....types.beta.assistant_stream_event import AssistantStreamEvent

src/openai/resources/chat/completions/completions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
completion_update_params,
3838
)
3939
from ...._base_client import AsyncPaginator, make_request_options
40-
from ....types.chat_model import ChatModel
40+
from ....types.shared.chat_model import ChatModel
4141
from ....types.chat.chat_completion import ChatCompletion
4242
from ....types.shared_params.metadata import Metadata
4343
from ....types.chat.chat_completion_chunk import ChatCompletionChunk

src/openai/types/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from .model import Model as Model
88
from .shared import (
99
Metadata as Metadata,
10+
ChatModel as ChatModel,
1011
ErrorObject as ErrorObject,
1112
FunctionDefinition as FunctionDefinition,
1213
FunctionParameters as FunctionParameters,
@@ -16,7 +17,6 @@
1617
)
1718
from .upload import Upload as Upload
1819
from .embedding import Embedding as Embedding
19-
from .chat_model import ChatModel as ChatModel
2020
from .completion import Completion as Completion
2121
from .moderation import Moderation as Moderation
2222
from .audio_model import AudioModel as AudioModel

src/openai/types/beta/assistant_create_params.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from typing import List, Union, Iterable, Optional
66
from typing_extensions import Literal, Required, TypedDict
77

8-
from ..chat_model import ChatModel
8+
from ..shared.chat_model import ChatModel
99
from .assistant_tool_param import AssistantToolParam
1010
from ..shared_params.metadata import Metadata
1111
from .file_chunking_strategy_param import FileChunkingStrategyParam

src/openai/types/beta/thread_create_and_run_params.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from typing import List, Union, Iterable, Optional
66
from typing_extensions import Literal, Required, TypeAlias, TypedDict
77

8-
from ..chat_model import ChatModel
8+
from ..shared.chat_model import ChatModel
99
from .function_tool_param import FunctionToolParam
1010
from .file_search_tool_param import FileSearchToolParam
1111
from ..shared_params.metadata import Metadata

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from typing import List, Union, Iterable, Optional
66
from typing_extensions import Literal, Required, TypeAlias, TypedDict
77

8-
from ...chat_model import ChatModel
8+
from ...shared.chat_model import ChatModel
99
from ..assistant_tool_param import AssistantToolParam
1010
from .runs.run_step_include import RunStepInclude
1111
from ...shared_params.metadata import Metadata

src/openai/types/chat/completion_create_params.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from typing import Dict, List, Union, Iterable, Optional
66
from typing_extensions import Literal, Required, TypeAlias, TypedDict
77

8-
from ..chat_model import ChatModel
8+
from ..shared.chat_model import ChatModel
99
from ..shared_params.metadata import Metadata
1010
from .chat_completion_modality import ChatCompletionModality
1111
from .chat_completion_tool_param import ChatCompletionToolParam

src/openai/types/chat_model.py

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

3-
from typing_extensions import Literal, TypeAlias
3+
4+
from .shared import chat_model
45

56
__all__ = ["ChatModel"]
67

7-
ChatModel: TypeAlias = Literal[
8-
"o3-mini",
9-
"o3-mini-2025-01-31",
10-
"o1",
11-
"o1-2024-12-17",
12-
"o1-preview",
13-
"o1-preview-2024-09-12",
14-
"o1-mini",
15-
"o1-mini-2024-09-12",
16-
"gpt-4.5-preview",
17-
"gpt-4.5-preview-2025-02-27",
18-
"gpt-4o",
19-
"gpt-4o-2024-11-20",
20-
"gpt-4o-2024-08-06",
21-
"gpt-4o-2024-05-13",
22-
"gpt-4o-audio-preview",
23-
"gpt-4o-audio-preview-2024-10-01",
24-
"gpt-4o-audio-preview-2024-12-17",
25-
"gpt-4o-mini-audio-preview",
26-
"gpt-4o-mini-audio-preview-2024-12-17",
27-
"chatgpt-4o-latest",
28-
"gpt-4o-mini",
29-
"gpt-4o-mini-2024-07-18",
30-
"gpt-4-turbo",
31-
"gpt-4-turbo-2024-04-09",
32-
"gpt-4-0125-preview",
33-
"gpt-4-turbo-preview",
34-
"gpt-4-1106-preview",
35-
"gpt-4-vision-preview",
36-
"gpt-4",
37-
"gpt-4-0314",
38-
"gpt-4-0613",
39-
"gpt-4-32k",
40-
"gpt-4-32k-0314",
41-
"gpt-4-32k-0613",
42-
"gpt-3.5-turbo",
43-
"gpt-3.5-turbo-16k",
44-
"gpt-3.5-turbo-0301",
45-
"gpt-3.5-turbo-0613",
46-
"gpt-3.5-turbo-1106",
47-
"gpt-3.5-turbo-0125",
48-
"gpt-3.5-turbo-16k-0613",
49-
]
8+
ChatModel = chat_model.ChatModel

src/openai/types/shared/__init__.py

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

33
from .metadata import Metadata as Metadata
4+
from .chat_model import ChatModel as ChatModel
45
from .error_object import ErrorObject as ErrorObject
56
from .function_definition import FunctionDefinition as FunctionDefinition
67
from .function_parameters import FunctionParameters as FunctionParameters

src/openai/types/shared/chat_model.py

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing_extensions import Literal, TypeAlias
4+
5+
__all__ = ["ChatModel"]
6+
7+
ChatModel: TypeAlias = Literal[
8+
"o3-mini",
9+
"o3-mini-2025-01-31",
10+
"o1",
11+
"o1-2024-12-17",
12+
"o1-preview",
13+
"o1-preview-2024-09-12",
14+
"o1-mini",
15+
"o1-mini-2024-09-12",
16+
"gpt-4.5-preview",
17+
"gpt-4.5-preview-2025-02-27",
18+
"gpt-4o",
19+
"gpt-4o-2024-11-20",
20+
"gpt-4o-2024-08-06",
21+
"gpt-4o-2024-05-13",
22+
"gpt-4o-audio-preview",
23+
"gpt-4o-audio-preview-2024-10-01",
24+
"gpt-4o-audio-preview-2024-12-17",
25+
"gpt-4o-mini-audio-preview",
26+
"gpt-4o-mini-audio-preview-2024-12-17",
27+
"chatgpt-4o-latest",
28+
"gpt-4o-mini",
29+
"gpt-4o-mini-2024-07-18",
30+
"gpt-4-turbo",
31+
"gpt-4-turbo-2024-04-09",
32+
"gpt-4-0125-preview",
33+
"gpt-4-turbo-preview",
34+
"gpt-4-1106-preview",
35+
"gpt-4-vision-preview",
36+
"gpt-4",
37+
"gpt-4-0314",
38+
"gpt-4-0613",
39+
"gpt-4-32k",
40+
"gpt-4-32k-0314",
41+
"gpt-4-32k-0613",
42+
"gpt-3.5-turbo",
43+
"gpt-3.5-turbo-16k",
44+
"gpt-3.5-turbo-0301",
45+
"gpt-3.5-turbo-0613",
46+
"gpt-3.5-turbo-1106",
47+
"gpt-3.5-turbo-0125",
48+
"gpt-3.5-turbo-16k-0613",
49+
]

src/openai/types/shared_params/__init__.py

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

33
from .metadata import Metadata as Metadata
4+
from .chat_model import ChatModel as ChatModel
45
from .function_definition import FunctionDefinition as FunctionDefinition
56
from .function_parameters import FunctionParameters as FunctionParameters
67
from .response_format_text import ResponseFormatText as ResponseFormatText
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import Literal, TypeAlias
6+
7+
__all__ = ["ChatModel"]
8+
9+
ChatModel: TypeAlias = Literal[
10+
"o3-mini",
11+
"o3-mini-2025-01-31",
12+
"o1",
13+
"o1-2024-12-17",
14+
"o1-preview",
15+
"o1-preview-2024-09-12",
16+
"o1-mini",
17+
"o1-mini-2024-09-12",
18+
"gpt-4.5-preview",
19+
"gpt-4.5-preview-2025-02-27",
20+
"gpt-4o",
21+
"gpt-4o-2024-11-20",
22+
"gpt-4o-2024-08-06",
23+
"gpt-4o-2024-05-13",
24+
"gpt-4o-audio-preview",
25+
"gpt-4o-audio-preview-2024-10-01",
26+
"gpt-4o-audio-preview-2024-12-17",
27+
"gpt-4o-mini-audio-preview",
28+
"gpt-4o-mini-audio-preview-2024-12-17",
29+
"chatgpt-4o-latest",
30+
"gpt-4o-mini",
31+
"gpt-4o-mini-2024-07-18",
32+
"gpt-4-turbo",
33+
"gpt-4-turbo-2024-04-09",
34+
"gpt-4-0125-preview",
35+
"gpt-4-turbo-preview",
36+
"gpt-4-1106-preview",
37+
"gpt-4-vision-preview",
38+
"gpt-4",
39+
"gpt-4-0314",
40+
"gpt-4-0613",
41+
"gpt-4-32k",
42+
"gpt-4-32k-0314",
43+
"gpt-4-32k-0613",
44+
"gpt-3.5-turbo",
45+
"gpt-3.5-turbo-16k",
46+
"gpt-3.5-turbo-0301",
47+
"gpt-3.5-turbo-0613",
48+
"gpt-3.5-turbo-1106",
49+
"gpt-3.5-turbo-0125",
50+
"gpt-3.5-turbo-16k-0613",
51+
]

0 commit comments

Comments
 (0)