Skip to content

Commit 001707b

Browse files
feat(api): o1-pro now available through the API (#2228)
1 parent 6ab1876 commit 001707b

File tree

14 files changed

+72
-25
lines changed

14 files changed

+72
-25
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 81
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-f3bce04386c4fcfd5037e0477fbaa39010003fd1558eb5185fe4a71dd6a05fdd.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-b26121d5df6eb5d3032a45a267473798b15fcfec76dd44a3256cf1238be05fa4.yml

api.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
```python
44
from openai.types import (
5+
AllModels,
56
ChatModel,
67
ComparisonFilter,
78
CompoundFilter,
@@ -14,6 +15,7 @@ from openai.types import (
1415
ResponseFormatJSONObject,
1516
ResponseFormatJSONSchema,
1617
ResponseFormatText,
18+
ResponsesModel,
1719
)
1820
```
1921

src/openai/resources/responses/responses.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@
2828
from ..._streaming import Stream, AsyncStream
2929
from ..._base_client import make_request_options
3030
from ...types.responses import response_create_params, response_retrieve_params
31-
from ...types.shared.chat_model import ChatModel
3231
from ...types.responses.response import Response
3332
from ...types.responses.tool_param import ToolParam
3433
from ...types.shared_params.metadata import Metadata
3534
from ...types.shared_params.reasoning import Reasoning
3635
from ...types.responses.response_includable import ResponseIncludable
36+
from ...types.shared_params.responses_model import ResponsesModel
3737
from ...types.responses.response_input_param import ResponseInputParam
3838
from ...types.responses.response_stream_event import ResponseStreamEvent
3939
from ...types.responses.response_text_config_param import ResponseTextConfigParam
@@ -70,7 +70,7 @@ def create(
7070
self,
7171
*,
7272
input: Union[str, ResponseInputParam],
73-
model: Union[str, ChatModel],
73+
model: ResponsesModel,
7474
include: Optional[List[ResponseIncludable]] | NotGiven = NOT_GIVEN,
7575
instructions: Optional[str] | NotGiven = NOT_GIVEN,
7676
max_output_tokens: Optional[int] | NotGiven = NOT_GIVEN,
@@ -235,7 +235,7 @@ def create(
235235
self,
236236
*,
237237
input: Union[str, ResponseInputParam],
238-
model: Union[str, ChatModel],
238+
model: ResponsesModel,
239239
stream: Literal[True],
240240
include: Optional[List[ResponseIncludable]] | NotGiven = NOT_GIVEN,
241241
instructions: Optional[str] | NotGiven = NOT_GIVEN,
@@ -400,7 +400,7 @@ def create(
400400
self,
401401
*,
402402
input: Union[str, ResponseInputParam],
403-
model: Union[str, ChatModel],
403+
model: ResponsesModel,
404404
stream: bool,
405405
include: Optional[List[ResponseIncludable]] | NotGiven = NOT_GIVEN,
406406
instructions: Optional[str] | NotGiven = NOT_GIVEN,
@@ -565,7 +565,7 @@ def create(
565565
self,
566566
*,
567567
input: Union[str, ResponseInputParam],
568-
model: Union[str, ChatModel],
568+
model: ResponsesModel,
569569
include: Optional[List[ResponseIncludable]] | NotGiven = NOT_GIVEN,
570570
instructions: Optional[str] | NotGiven = NOT_GIVEN,
571571
max_output_tokens: Optional[int] | NotGiven = NOT_GIVEN,
@@ -727,7 +727,7 @@ async def create(
727727
self,
728728
*,
729729
input: Union[str, ResponseInputParam],
730-
model: Union[str, ChatModel],
730+
model: ResponsesModel,
731731
include: Optional[List[ResponseIncludable]] | NotGiven = NOT_GIVEN,
732732
instructions: Optional[str] | NotGiven = NOT_GIVEN,
733733
max_output_tokens: Optional[int] | NotGiven = NOT_GIVEN,
@@ -892,7 +892,7 @@ async def create(
892892
self,
893893
*,
894894
input: Union[str, ResponseInputParam],
895-
model: Union[str, ChatModel],
895+
model: ResponsesModel,
896896
stream: Literal[True],
897897
include: Optional[List[ResponseIncludable]] | NotGiven = NOT_GIVEN,
898898
instructions: Optional[str] | NotGiven = NOT_GIVEN,
@@ -1057,7 +1057,7 @@ async def create(
10571057
self,
10581058
*,
10591059
input: Union[str, ResponseInputParam],
1060-
model: Union[str, ChatModel],
1060+
model: ResponsesModel,
10611061
stream: bool,
10621062
include: Optional[List[ResponseIncludable]] | NotGiven = NOT_GIVEN,
10631063
instructions: Optional[str] | NotGiven = NOT_GIVEN,
@@ -1222,7 +1222,7 @@ async def create(
12221222
self,
12231223
*,
12241224
input: Union[str, ResponseInputParam],
1225-
model: Union[str, ChatModel],
1225+
model: ResponsesModel,
12261226
include: Optional[List[ResponseIncludable]] | NotGiven = NOT_GIVEN,
12271227
instructions: Optional[str] | NotGiven = NOT_GIVEN,
12281228
max_output_tokens: Optional[int] | NotGiven = NOT_GIVEN,

src/openai/types/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@
77
from .model import Model as Model
88
from .shared import (
99
Metadata as Metadata,
10+
AllModels as AllModels,
1011
ChatModel as ChatModel,
1112
Reasoning as Reasoning,
1213
ErrorObject as ErrorObject,
1314
CompoundFilter as CompoundFilter,
15+
ResponsesModel as ResponsesModel,
1416
ReasoningEffort as ReasoningEffort,
1517
ComparisonFilter as ComparisonFilter,
1618
FunctionDefinition as FunctionDefinition,

src/openai/types/responses/response.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
from ..shared.metadata import Metadata
1212
from ..shared.reasoning import Reasoning
1313
from .tool_choice_types import ToolChoiceTypes
14-
from ..shared.chat_model import ChatModel
1514
from .tool_choice_options import ToolChoiceOptions
1615
from .response_output_item import ResponseOutputItem
1716
from .response_text_config import ResponseTextConfig
1817
from .tool_choice_function import ToolChoiceFunction
18+
from ..shared.responses_model import ResponsesModel
1919

2020
__all__ = ["Response", "IncompleteDetails", "ToolChoice"]
2121

@@ -61,7 +61,7 @@ class Response(BaseModel):
6161
a maximum length of 512 characters.
6262
"""
6363

64-
model: Union[str, ChatModel]
64+
model: ResponsesModel
6565
"""Model ID used to generate the response, like `gpt-4o` or `o1`.
6666
6767
OpenAI offers a wide range of models with different capabilities, performance

src/openai/types/responses/response_create_params.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
from typing_extensions import Literal, Required, TypeAlias, TypedDict
77

88
from .tool_param import ToolParam
9-
from ..shared.chat_model import ChatModel
109
from .response_includable import ResponseIncludable
1110
from .tool_choice_options import ToolChoiceOptions
1211
from .response_input_param import ResponseInputParam
@@ -15,6 +14,7 @@
1514
from ..shared_params.reasoning import Reasoning
1615
from .response_text_config_param import ResponseTextConfigParam
1716
from .tool_choice_function_param import ToolChoiceFunctionParam
17+
from ..shared_params.responses_model import ResponsesModel
1818

1919
__all__ = [
2020
"ResponseCreateParamsBase",
@@ -37,7 +37,7 @@ class ResponseCreateParamsBase(TypedDict, total=False):
3737
- [Function calling](https://platform.openai.com/docs/guides/function-calling)
3838
"""
3939

40-
model: Required[Union[str, ChatModel]]
40+
model: Required[ResponsesModel]
4141
"""Model ID used to generate the response, like `gpt-4o` or `o1`.
4242
4343
OpenAI offers a wide range of models with different capabilities, performance

src/openai/types/responses/response_function_tool_call_item.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99
class ResponseFunctionToolCallItem(ResponseFunctionToolCall):
1010
id: str # type: ignore
11-
"""The unique ID of the function call tool output."""
11+
"""The unique ID of the function tool call."""

src/openai/types/shared/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
from .metadata import Metadata as Metadata
44
from .reasoning import Reasoning as Reasoning
5+
from .all_models import AllModels as AllModels
56
from .chat_model import ChatModel as ChatModel
67
from .error_object import ErrorObject as ErrorObject
78
from .compound_filter import CompoundFilter as CompoundFilter
9+
from .responses_model import ResponsesModel as ResponsesModel
810
from .reasoning_effort import ReasoningEffort as ReasoningEffort
911
from .comparison_filter import ComparisonFilter as ComparisonFilter
1012
from .function_definition import FunctionDefinition as FunctionDefinition

src/openai/types/shared/all_models.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import Union
4+
from typing_extensions import Literal, TypeAlias
5+
6+
from .chat_model import ChatModel
7+
8+
__all__ = ["AllModels"]
9+
10+
AllModels: TypeAlias = Union[
11+
str,
12+
ChatModel,
13+
str,
14+
ChatModel,
15+
Literal["o1-pro", "o1-pro-2025-03-19", "computer-use-preview", "computer-use-preview-2025-03-11"],
16+
]

src/openai/types/shared/chat_model.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@
1313
"o1-preview-2024-09-12",
1414
"o1-mini",
1515
"o1-mini-2024-09-12",
16-
"computer-use-preview",
17-
"computer-use-preview-2025-02-04",
18-
"computer-use-preview-2025-03-11",
19-
"gpt-4.5-preview",
20-
"gpt-4.5-preview-2025-02-27",
2116
"gpt-4o",
2217
"gpt-4o-2024-11-20",
2318
"gpt-4o-2024-08-06",
@@ -27,6 +22,10 @@
2722
"gpt-4o-audio-preview-2024-12-17",
2823
"gpt-4o-mini-audio-preview",
2924
"gpt-4o-mini-audio-preview-2024-12-17",
25+
"gpt-4o-search-preview",
26+
"gpt-4o-mini-search-preview",
27+
"gpt-4o-search-preview-2025-03-11",
28+
"gpt-4o-mini-search-preview-2025-03-11",
3029
"chatgpt-4o-latest",
3130
"gpt-4o-mini",
3231
"gpt-4o-mini-2024-07-18",
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import Union
4+
from typing_extensions import Literal, TypeAlias
5+
6+
from .chat_model import ChatModel
7+
8+
__all__ = ["ResponsesModel"]
9+
10+
ResponsesModel: TypeAlias = Union[
11+
str, ChatModel, Literal["o1-pro", "o1-pro-2025-03-19", "computer-use-preview", "computer-use-preview-2025-03-11"]
12+
]

src/openai/types/shared_params/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from .reasoning import Reasoning as Reasoning
55
from .chat_model import ChatModel as ChatModel
66
from .compound_filter import CompoundFilter as CompoundFilter
7+
from .responses_model import ResponsesModel as ResponsesModel
78
from .reasoning_effort import ReasoningEffort as ReasoningEffort
89
from .comparison_filter import ComparisonFilter as ComparisonFilter
910
from .function_definition import FunctionDefinition as FunctionDefinition

src/openai/types/shared_params/chat_model.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@
1515
"o1-preview-2024-09-12",
1616
"o1-mini",
1717
"o1-mini-2024-09-12",
18-
"computer-use-preview",
19-
"computer-use-preview-2025-02-04",
20-
"computer-use-preview-2025-03-11",
21-
"gpt-4.5-preview",
22-
"gpt-4.5-preview-2025-02-27",
2318
"gpt-4o",
2419
"gpt-4o-2024-11-20",
2520
"gpt-4o-2024-08-06",
@@ -29,6 +24,10 @@
2924
"gpt-4o-audio-preview-2024-12-17",
3025
"gpt-4o-mini-audio-preview",
3126
"gpt-4o-mini-audio-preview-2024-12-17",
27+
"gpt-4o-search-preview",
28+
"gpt-4o-mini-search-preview",
29+
"gpt-4o-search-preview-2025-03-11",
30+
"gpt-4o-mini-search-preview-2025-03-11",
3231
"chatgpt-4o-latest",
3332
"gpt-4o-mini",
3433
"gpt-4o-mini-2024-07-18",
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing import Union
6+
from typing_extensions import Literal, TypeAlias
7+
8+
from ..shared.chat_model import ChatModel
9+
10+
__all__ = ["ResponsesModel"]
11+
12+
ResponsesModel: TypeAlias = Union[
13+
str, ChatModel, Literal["o1-pro", "o1-pro-2025-03-19", "computer-use-preview", "computer-use-preview-2025-03-11"]
14+
]

0 commit comments

Comments
 (0)