Skip to content

feat(api): o1-pro now available through the API #2228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 81
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-f3bce04386c4fcfd5037e0477fbaa39010003fd1558eb5185fe4a71dd6a05fdd.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-b26121d5df6eb5d3032a45a267473798b15fcfec76dd44a3256cf1238be05fa4.yml
2 changes: 2 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

```python
from openai.types import (
AllModels,
ChatModel,
ComparisonFilter,
CompoundFilter,
Expand All @@ -14,6 +15,7 @@ from openai.types import (
ResponseFormatJSONObject,
ResponseFormatJSONSchema,
ResponseFormatText,
ResponsesModel,
)
```

Expand Down
18 changes: 9 additions & 9 deletions src/openai/resources/responses/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
from ..._streaming import Stream, AsyncStream
from ..._base_client import make_request_options
from ...types.responses import response_create_params, response_retrieve_params
from ...types.shared.chat_model import ChatModel
from ...types.responses.response import Response
from ...types.responses.tool_param import ToolParam
from ...types.shared_params.metadata import Metadata
from ...types.shared_params.reasoning import Reasoning
from ...types.responses.response_includable import ResponseIncludable
from ...types.shared_params.responses_model import ResponsesModel
from ...types.responses.response_input_param import ResponseInputParam
from ...types.responses.response_stream_event import ResponseStreamEvent
from ...types.responses.response_text_config_param import ResponseTextConfigParam
Expand Down Expand Up @@ -70,7 +70,7 @@ def create(
self,
*,
input: Union[str, ResponseInputParam],
model: Union[str, ChatModel],
model: ResponsesModel,
include: Optional[List[ResponseIncludable]] | NotGiven = NOT_GIVEN,
instructions: Optional[str] | NotGiven = NOT_GIVEN,
max_output_tokens: Optional[int] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -235,7 +235,7 @@ def create(
self,
*,
input: Union[str, ResponseInputParam],
model: Union[str, ChatModel],
model: ResponsesModel,
stream: Literal[True],
include: Optional[List[ResponseIncludable]] | NotGiven = NOT_GIVEN,
instructions: Optional[str] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -400,7 +400,7 @@ def create(
self,
*,
input: Union[str, ResponseInputParam],
model: Union[str, ChatModel],
model: ResponsesModel,
stream: bool,
include: Optional[List[ResponseIncludable]] | NotGiven = NOT_GIVEN,
instructions: Optional[str] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -565,7 +565,7 @@ def create(
self,
*,
input: Union[str, ResponseInputParam],
model: Union[str, ChatModel],
model: ResponsesModel,
include: Optional[List[ResponseIncludable]] | NotGiven = NOT_GIVEN,
instructions: Optional[str] | NotGiven = NOT_GIVEN,
max_output_tokens: Optional[int] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -727,7 +727,7 @@ async def create(
self,
*,
input: Union[str, ResponseInputParam],
model: Union[str, ChatModel],
model: ResponsesModel,
include: Optional[List[ResponseIncludable]] | NotGiven = NOT_GIVEN,
instructions: Optional[str] | NotGiven = NOT_GIVEN,
max_output_tokens: Optional[int] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -892,7 +892,7 @@ async def create(
self,
*,
input: Union[str, ResponseInputParam],
model: Union[str, ChatModel],
model: ResponsesModel,
stream: Literal[True],
include: Optional[List[ResponseIncludable]] | NotGiven = NOT_GIVEN,
instructions: Optional[str] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -1057,7 +1057,7 @@ async def create(
self,
*,
input: Union[str, ResponseInputParam],
model: Union[str, ChatModel],
model: ResponsesModel,
stream: bool,
include: Optional[List[ResponseIncludable]] | NotGiven = NOT_GIVEN,
instructions: Optional[str] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -1222,7 +1222,7 @@ async def create(
self,
*,
input: Union[str, ResponseInputParam],
model: Union[str, ChatModel],
model: ResponsesModel,
include: Optional[List[ResponseIncludable]] | NotGiven = NOT_GIVEN,
instructions: Optional[str] | NotGiven = NOT_GIVEN,
max_output_tokens: Optional[int] | NotGiven = NOT_GIVEN,
Expand Down
2 changes: 2 additions & 0 deletions src/openai/types/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
from .model import Model as Model
from .shared import (
Metadata as Metadata,
AllModels as AllModels,
ChatModel as ChatModel,
Reasoning as Reasoning,
ErrorObject as ErrorObject,
CompoundFilter as CompoundFilter,
ResponsesModel as ResponsesModel,
ReasoningEffort as ReasoningEffort,
ComparisonFilter as ComparisonFilter,
FunctionDefinition as FunctionDefinition,
Expand Down
4 changes: 2 additions & 2 deletions src/openai/types/responses/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
from ..shared.metadata import Metadata
from ..shared.reasoning import Reasoning
from .tool_choice_types import ToolChoiceTypes
from ..shared.chat_model import ChatModel
from .tool_choice_options import ToolChoiceOptions
from .response_output_item import ResponseOutputItem
from .response_text_config import ResponseTextConfig
from .tool_choice_function import ToolChoiceFunction
from ..shared.responses_model import ResponsesModel

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

Expand Down Expand Up @@ -61,7 +61,7 @@ class Response(BaseModel):
a maximum length of 512 characters.
"""

model: Union[str, ChatModel]
model: ResponsesModel
"""Model ID used to generate the response, like `gpt-4o` or `o1`.

OpenAI offers a wide range of models with different capabilities, performance
Expand Down
4 changes: 2 additions & 2 deletions src/openai/types/responses/response_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from typing_extensions import Literal, Required, TypeAlias, TypedDict

from .tool_param import ToolParam
from ..shared.chat_model import ChatModel
from .response_includable import ResponseIncludable
from .tool_choice_options import ToolChoiceOptions
from .response_input_param import ResponseInputParam
Expand All @@ -15,6 +14,7 @@
from ..shared_params.reasoning import Reasoning
from .response_text_config_param import ResponseTextConfigParam
from .tool_choice_function_param import ToolChoiceFunctionParam
from ..shared_params.responses_model import ResponsesModel

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

model: Required[Union[str, ChatModel]]
model: Required[ResponsesModel]
"""Model ID used to generate the response, like `gpt-4o` or `o1`.

OpenAI offers a wide range of models with different capabilities, performance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

class ResponseFunctionToolCallItem(ResponseFunctionToolCall):
id: str # type: ignore
"""The unique ID of the function call tool output."""
"""The unique ID of the function tool call."""
2 changes: 2 additions & 0 deletions src/openai/types/shared/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

from .metadata import Metadata as Metadata
from .reasoning import Reasoning as Reasoning
from .all_models import AllModels as AllModels
from .chat_model import ChatModel as ChatModel
from .error_object import ErrorObject as ErrorObject
from .compound_filter import CompoundFilter as CompoundFilter
from .responses_model import ResponsesModel as ResponsesModel
from .reasoning_effort import ReasoningEffort as ReasoningEffort
from .comparison_filter import ComparisonFilter as ComparisonFilter
from .function_definition import FunctionDefinition as FunctionDefinition
Expand Down
16 changes: 16 additions & 0 deletions src/openai/types/shared/all_models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Union
from typing_extensions import Literal, TypeAlias

from .chat_model import ChatModel

__all__ = ["AllModels"]

AllModels: TypeAlias = Union[
str,
ChatModel,
str,
ChatModel,
Literal["o1-pro", "o1-pro-2025-03-19", "computer-use-preview", "computer-use-preview-2025-03-11"],
]
9 changes: 4 additions & 5 deletions src/openai/types/shared/chat_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@
"o1-preview-2024-09-12",
"o1-mini",
"o1-mini-2024-09-12",
"computer-use-preview",
"computer-use-preview-2025-02-04",
"computer-use-preview-2025-03-11",
"gpt-4.5-preview",
"gpt-4.5-preview-2025-02-27",
"gpt-4o",
"gpt-4o-2024-11-20",
"gpt-4o-2024-08-06",
Expand All @@ -27,6 +22,10 @@
"gpt-4o-audio-preview-2024-12-17",
"gpt-4o-mini-audio-preview",
"gpt-4o-mini-audio-preview-2024-12-17",
"gpt-4o-search-preview",
"gpt-4o-mini-search-preview",
"gpt-4o-search-preview-2025-03-11",
"gpt-4o-mini-search-preview-2025-03-11",
"chatgpt-4o-latest",
"gpt-4o-mini",
"gpt-4o-mini-2024-07-18",
Expand Down
12 changes: 12 additions & 0 deletions src/openai/types/shared/responses_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import Union
from typing_extensions import Literal, TypeAlias

from .chat_model import ChatModel

__all__ = ["ResponsesModel"]

ResponsesModel: TypeAlias = Union[
str, ChatModel, Literal["o1-pro", "o1-pro-2025-03-19", "computer-use-preview", "computer-use-preview-2025-03-11"]
]
1 change: 1 addition & 0 deletions src/openai/types/shared_params/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from .reasoning import Reasoning as Reasoning
from .chat_model import ChatModel as ChatModel
from .compound_filter import CompoundFilter as CompoundFilter
from .responses_model import ResponsesModel as ResponsesModel
from .reasoning_effort import ReasoningEffort as ReasoningEffort
from .comparison_filter import ComparisonFilter as ComparisonFilter
from .function_definition import FunctionDefinition as FunctionDefinition
Expand Down
9 changes: 4 additions & 5 deletions src/openai/types/shared_params/chat_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@
"o1-preview-2024-09-12",
"o1-mini",
"o1-mini-2024-09-12",
"computer-use-preview",
"computer-use-preview-2025-02-04",
"computer-use-preview-2025-03-11",
"gpt-4.5-preview",
"gpt-4.5-preview-2025-02-27",
"gpt-4o",
"gpt-4o-2024-11-20",
"gpt-4o-2024-08-06",
Expand All @@ -29,6 +24,10 @@
"gpt-4o-audio-preview-2024-12-17",
"gpt-4o-mini-audio-preview",
"gpt-4o-mini-audio-preview-2024-12-17",
"gpt-4o-search-preview",
"gpt-4o-mini-search-preview",
"gpt-4o-search-preview-2025-03-11",
"gpt-4o-mini-search-preview-2025-03-11",
"chatgpt-4o-latest",
"gpt-4o-mini",
"gpt-4o-mini-2024-07-18",
Expand Down
14 changes: 14 additions & 0 deletions src/openai/types/shared_params/responses_model.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from __future__ import annotations

from typing import Union
from typing_extensions import Literal, TypeAlias

from ..shared.chat_model import ChatModel

__all__ = ["ResponsesModel"]

ResponsesModel: TypeAlias = Union[
str, ChatModel, Literal["o1-pro", "o1-pro-2025-03-19", "computer-use-preview", "computer-use-preview-2025-03-11"]
]