Skip to content

Commit

Permalink
fix(api): add missing reasoning effort + model enums (#2096)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and RobertCraigie committed Feb 6, 2025
1 parent 0288213 commit e0ca9f0
Show file tree
Hide file tree
Showing 12 changed files with 268 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 69
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-fc5dbc19505b0035f9e7f88868619f4fb519b048bde011f6154f3132d4be71fb.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-7c699d4503077d06a4a44f52c0c1f902d19a87c766b8be75b97c8dfd484ad4aa.yml
106 changes: 104 additions & 2 deletions src/openai/resources/beta/assistants.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def create(
instructions: Optional[str] | NotGiven = NOT_GIVEN,
metadata: Optional[Metadata] | NotGiven = NOT_GIVEN,
name: Optional[str] | NotGiven = NOT_GIVEN,
reasoning_effort: Optional[Literal["low", "medium", "high"]] | NotGiven = NOT_GIVEN,
response_format: Optional[AssistantResponseFormatOptionParam] | NotGiven = NOT_GIVEN,
temperature: Optional[float] | NotGiven = NOT_GIVEN,
tool_resources: Optional[assistant_create_params.ToolResources] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -97,6 +98,13 @@ def create(
name: The name of the assistant. The maximum length is 256 characters.
reasoning_effort: **o1 and o3-mini models only**
Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
supported values are `low`, `medium`, and `high`. Reducing reasoning effort can
result in faster responses and fewer tokens used on reasoning in a response.
response_format: Specifies the format that the model must output. Compatible with
[GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
[GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4),
Expand Down Expand Up @@ -155,6 +163,7 @@ def create(
"instructions": instructions,
"metadata": metadata,
"name": name,
"reasoning_effort": reasoning_effort,
"response_format": response_format,
"temperature": temperature,
"tool_resources": tool_resources,
Expand Down Expand Up @@ -210,8 +219,42 @@ def update(
description: Optional[str] | NotGiven = NOT_GIVEN,
instructions: Optional[str] | NotGiven = NOT_GIVEN,
metadata: Optional[Metadata] | NotGiven = NOT_GIVEN,
model: str | NotGiven = NOT_GIVEN,
model: Union[
str,
Literal[
"o3-mini",
"o3-mini-2025-01-31",
"o1",
"o1-2024-12-17",
"gpt-4o",
"gpt-4o-2024-11-20",
"gpt-4o-2024-08-06",
"gpt-4o-2024-05-13",
"gpt-4o-mini",
"gpt-4o-mini-2024-07-18",
"gpt-4-turbo",
"gpt-4-turbo-2024-04-09",
"gpt-4-0125-preview",
"gpt-4-turbo-preview",
"gpt-4-1106-preview",
"gpt-4-vision-preview",
"gpt-4",
"gpt-4-0314",
"gpt-4-0613",
"gpt-4-32k",
"gpt-4-32k-0314",
"gpt-4-32k-0613",
"gpt-3.5-turbo",
"gpt-3.5-turbo-16k",
"gpt-3.5-turbo-0613",
"gpt-3.5-turbo-1106",
"gpt-3.5-turbo-0125",
"gpt-3.5-turbo-16k-0613",
],
]
| NotGiven = NOT_GIVEN,
name: Optional[str] | NotGiven = NOT_GIVEN,
reasoning_effort: Optional[Literal["low", "medium", "high"]] | NotGiven = NOT_GIVEN,
response_format: Optional[AssistantResponseFormatOptionParam] | NotGiven = NOT_GIVEN,
temperature: Optional[float] | NotGiven = NOT_GIVEN,
tool_resources: Optional[assistant_update_params.ToolResources] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -249,6 +292,13 @@ def update(
name: The name of the assistant. The maximum length is 256 characters.
reasoning_effort: **o1 and o3-mini models only**
Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
supported values are `low`, `medium`, and `high`. Reducing reasoning effort can
result in faster responses and fewer tokens used on reasoning in a response.
response_format: Specifies the format that the model must output. Compatible with
[GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
[GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4),
Expand Down Expand Up @@ -309,6 +359,7 @@ def update(
"metadata": metadata,
"model": model,
"name": name,
"reasoning_effort": reasoning_effort,
"response_format": response_format,
"temperature": temperature,
"tool_resources": tool_resources,
Expand Down Expand Up @@ -451,6 +502,7 @@ async def create(
instructions: Optional[str] | NotGiven = NOT_GIVEN,
metadata: Optional[Metadata] | NotGiven = NOT_GIVEN,
name: Optional[str] | NotGiven = NOT_GIVEN,
reasoning_effort: Optional[Literal["low", "medium", "high"]] | NotGiven = NOT_GIVEN,
response_format: Optional[AssistantResponseFormatOptionParam] | NotGiven = NOT_GIVEN,
temperature: Optional[float] | NotGiven = NOT_GIVEN,
tool_resources: Optional[assistant_create_params.ToolResources] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -487,6 +539,13 @@ async def create(
name: The name of the assistant. The maximum length is 256 characters.
reasoning_effort: **o1 and o3-mini models only**
Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
supported values are `low`, `medium`, and `high`. Reducing reasoning effort can
result in faster responses and fewer tokens used on reasoning in a response.
response_format: Specifies the format that the model must output. Compatible with
[GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
[GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4),
Expand Down Expand Up @@ -545,6 +604,7 @@ async def create(
"instructions": instructions,
"metadata": metadata,
"name": name,
"reasoning_effort": reasoning_effort,
"response_format": response_format,
"temperature": temperature,
"tool_resources": tool_resources,
Expand Down Expand Up @@ -600,8 +660,42 @@ async def update(
description: Optional[str] | NotGiven = NOT_GIVEN,
instructions: Optional[str] | NotGiven = NOT_GIVEN,
metadata: Optional[Metadata] | NotGiven = NOT_GIVEN,
model: str | NotGiven = NOT_GIVEN,
model: Union[
str,
Literal[
"o3-mini",
"o3-mini-2025-01-31",
"o1",
"o1-2024-12-17",
"gpt-4o",
"gpt-4o-2024-11-20",
"gpt-4o-2024-08-06",
"gpt-4o-2024-05-13",
"gpt-4o-mini",
"gpt-4o-mini-2024-07-18",
"gpt-4-turbo",
"gpt-4-turbo-2024-04-09",
"gpt-4-0125-preview",
"gpt-4-turbo-preview",
"gpt-4-1106-preview",
"gpt-4-vision-preview",
"gpt-4",
"gpt-4-0314",
"gpt-4-0613",
"gpt-4-32k",
"gpt-4-32k-0314",
"gpt-4-32k-0613",
"gpt-3.5-turbo",
"gpt-3.5-turbo-16k",
"gpt-3.5-turbo-0613",
"gpt-3.5-turbo-1106",
"gpt-3.5-turbo-0125",
"gpt-3.5-turbo-16k-0613",
],
]
| NotGiven = NOT_GIVEN,
name: Optional[str] | NotGiven = NOT_GIVEN,
reasoning_effort: Optional[Literal["low", "medium", "high"]] | NotGiven = NOT_GIVEN,
response_format: Optional[AssistantResponseFormatOptionParam] | NotGiven = NOT_GIVEN,
temperature: Optional[float] | NotGiven = NOT_GIVEN,
tool_resources: Optional[assistant_update_params.ToolResources] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -639,6 +733,13 @@ async def update(
name: The name of the assistant. The maximum length is 256 characters.
reasoning_effort: **o1 and o3-mini models only**
Constrains effort on reasoning for
[reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
supported values are `low`, `medium`, and `high`. Reducing reasoning effort can
result in faster responses and fewer tokens used on reasoning in a response.
response_format: Specifies the format that the model must output. Compatible with
[GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
[GPT-4 Turbo](https://platform.openai.com/docs/models#gpt-4-turbo-and-gpt-4),
Expand Down Expand Up @@ -699,6 +800,7 @@ async def update(
"metadata": metadata,
"model": model,
"name": name,
"reasoning_effort": reasoning_effort,
"response_format": response_format,
"temperature": temperature,
"tool_resources": tool_resources,
Expand Down
8 changes: 4 additions & 4 deletions src/openai/resources/beta/chat/completions.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def parse(
parallel_tool_calls: bool | NotGiven = NOT_GIVEN,
prediction: Optional[ChatCompletionPredictionContentParam] | NotGiven = NOT_GIVEN,
presence_penalty: Optional[float] | NotGiven = NOT_GIVEN,
reasoning_effort: ChatCompletionReasoningEffort | NotGiven = NOT_GIVEN,
reasoning_effort: Optional[ChatCompletionReasoningEffort] | NotGiven = NOT_GIVEN,
seed: Optional[int] | NotGiven = NOT_GIVEN,
service_tier: Optional[Literal["auto", "default"]] | NotGiven = NOT_GIVEN,
stop: Union[Optional[str], List[str]] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -228,7 +228,7 @@ def stream(
parallel_tool_calls: bool | NotGiven = NOT_GIVEN,
prediction: Optional[ChatCompletionPredictionContentParam] | NotGiven = NOT_GIVEN,
presence_penalty: Optional[float] | NotGiven = NOT_GIVEN,
reasoning_effort: ChatCompletionReasoningEffort | NotGiven = NOT_GIVEN,
reasoning_effort: Optional[ChatCompletionReasoningEffort] | NotGiven = NOT_GIVEN,
seed: Optional[int] | NotGiven = NOT_GIVEN,
service_tier: Optional[Literal["auto", "default"]] | NotGiven = NOT_GIVEN,
stop: Union[Optional[str], List[str]] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -358,7 +358,7 @@ async def parse(
parallel_tool_calls: bool | NotGiven = NOT_GIVEN,
prediction: Optional[ChatCompletionPredictionContentParam] | NotGiven = NOT_GIVEN,
presence_penalty: Optional[float] | NotGiven = NOT_GIVEN,
reasoning_effort: ChatCompletionReasoningEffort | NotGiven = NOT_GIVEN,
reasoning_effort: Optional[ChatCompletionReasoningEffort] | NotGiven = NOT_GIVEN,
seed: Optional[int] | NotGiven = NOT_GIVEN,
service_tier: Optional[Literal["auto", "default"]] | NotGiven = NOT_GIVEN,
stop: Union[Optional[str], List[str]] | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -503,7 +503,7 @@ def stream(
parallel_tool_calls: bool | NotGiven = NOT_GIVEN,
prediction: Optional[ChatCompletionPredictionContentParam] | NotGiven = NOT_GIVEN,
presence_penalty: Optional[float] | NotGiven = NOT_GIVEN,
reasoning_effort: ChatCompletionReasoningEffort | NotGiven = NOT_GIVEN,
reasoning_effort: Optional[ChatCompletionReasoningEffort] | NotGiven = NOT_GIVEN,
seed: Optional[int] | NotGiven = NOT_GIVEN,
service_tier: Optional[Literal["auto", "default"]] | NotGiven = NOT_GIVEN,
stop: Union[Optional[str], List[str]] | NotGiven = NOT_GIVEN,
Expand Down
Loading

0 comments on commit e0ca9f0

Please sign in to comment.