Skip to content

Commit

Permalink
fix(api): add missing reasoning effort + model enums (#1302)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Feb 5, 2025
1 parent 41a7ce3 commit 14c55c3
Show file tree
Hide file tree
Showing 6 changed files with 67 additions and 6 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
51 changes: 50 additions & 1 deletion src/resources/beta/assistants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1133,6 +1133,16 @@ export interface AssistantCreateParams {
*/
name?: string | null;

/**
* **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.
*/
reasoning_effort?: 'low' | 'medium' | 'high' | null;

/**
* Specifies the format that the model must output. Compatible with
* [GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
Expand Down Expand Up @@ -1288,13 +1298,52 @@ export interface AssistantUpdateParams {
* [Model overview](https://platform.openai.com/docs/models) for descriptions of
* them.
*/
model?: string;
model?:
| (string & {})
| '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';

/**
* The name of the assistant. The maximum length is 256 characters.
*/
name?: string | null;

/**
* **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.
*/
reasoning_effort?: 'low' | 'medium' | 'high' | null;

/**
* Specifies the format that the model must output. Compatible with
* [GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
Expand Down
10 changes: 10 additions & 0 deletions src/resources/beta/threads/runs/runs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,16 @@ export interface RunCreateParamsBase {
*/
parallel_tool_calls?: boolean;

/**
* Body param: **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.
*/
reasoning_effort?: 'low' | 'medium' | 'high' | null;

/**
* Body param: Specifies the format that the model must output. Compatible with
* [GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
Expand Down
8 changes: 4 additions & 4 deletions src/resources/chat/completions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -744,14 +744,14 @@ export interface ChatCompletionPredictionContent {
}

/**
* **o1 models only**
* **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.
*/
export type ChatCompletionReasoningEffort = 'low' | 'medium' | 'high';
export type ChatCompletionReasoningEffort = 'low' | 'medium' | 'high' | null;

/**
* The role of the author of a message
Expand Down Expand Up @@ -1063,14 +1063,14 @@ export interface ChatCompletionCreateParamsBase {
presence_penalty?: number | null;

/**
* **o1 models only**
* **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.
*/
reasoning_effort?: ChatCompletionReasoningEffort;
reasoning_effort?: ChatCompletionReasoningEffort | null;

/**
* An object specifying the format that the model must output.
Expand Down
1 change: 1 addition & 0 deletions tests/api-resources/beta/assistants.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ describe('resource assistants', () => {
instructions: 'instructions',
metadata: { foo: 'string' },
name: 'name',
reasoning_effort: 'low',
response_format: 'auto',
temperature: 1,
tool_resources: {
Expand Down
1 change: 1 addition & 0 deletions tests/api-resources/beta/threads/runs/runs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ describe('resource runs', () => {
metadata: { foo: 'string' },
model: 'gpt-4o',
parallel_tool_calls: true,
reasoning_effort: 'low',
response_format: 'auto',
stream: false,
temperature: 1,
Expand Down

0 comments on commit 14c55c3

Please sign in to comment.