Skip to content

Commit 27d354a

Browse files
fix(api): add missing reasoning effort + model enums (#1302)
1 parent 2a43456 commit 27d354a

File tree

6 files changed

+67
-6
lines changed

6 files changed

+67
-6
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 69
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-fc5dbc19505b0035f9e7f88868619f4fb519b048bde011f6154f3132d4be71fb.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-7c699d4503077d06a4a44f52c0c1f902d19a87c766b8be75b97c8dfd484ad4aa.yml

src/resources/beta/assistants.ts

+50-1
Original file line numberDiff line numberDiff line change
@@ -1133,6 +1133,16 @@ export interface AssistantCreateParams {
11331133
*/
11341134
name?: string | null;
11351135

1136+
/**
1137+
* **o1 and o3-mini models only**
1138+
*
1139+
* Constrains effort on reasoning for
1140+
* [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
1141+
* supported values are `low`, `medium`, and `high`. Reducing reasoning effort can
1142+
* result in faster responses and fewer tokens used on reasoning in a response.
1143+
*/
1144+
reasoning_effort?: 'low' | 'medium' | 'high' | null;
1145+
11361146
/**
11371147
* Specifies the format that the model must output. Compatible with
11381148
* [GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
@@ -1288,13 +1298,52 @@ export interface AssistantUpdateParams {
12881298
* [Model overview](https://platform.openai.com/docs/models) for descriptions of
12891299
* them.
12901300
*/
1291-
model?: string;
1301+
model?:
1302+
| (string & {})
1303+
| 'o3-mini'
1304+
| 'o3-mini-2025-01-31'
1305+
| 'o1'
1306+
| 'o1-2024-12-17'
1307+
| 'gpt-4o'
1308+
| 'gpt-4o-2024-11-20'
1309+
| 'gpt-4o-2024-08-06'
1310+
| 'gpt-4o-2024-05-13'
1311+
| 'gpt-4o-mini'
1312+
| 'gpt-4o-mini-2024-07-18'
1313+
| 'gpt-4-turbo'
1314+
| 'gpt-4-turbo-2024-04-09'
1315+
| 'gpt-4-0125-preview'
1316+
| 'gpt-4-turbo-preview'
1317+
| 'gpt-4-1106-preview'
1318+
| 'gpt-4-vision-preview'
1319+
| 'gpt-4'
1320+
| 'gpt-4-0314'
1321+
| 'gpt-4-0613'
1322+
| 'gpt-4-32k'
1323+
| 'gpt-4-32k-0314'
1324+
| 'gpt-4-32k-0613'
1325+
| 'gpt-3.5-turbo'
1326+
| 'gpt-3.5-turbo-16k'
1327+
| 'gpt-3.5-turbo-0613'
1328+
| 'gpt-3.5-turbo-1106'
1329+
| 'gpt-3.5-turbo-0125'
1330+
| 'gpt-3.5-turbo-16k-0613';
12921331

12931332
/**
12941333
* The name of the assistant. The maximum length is 256 characters.
12951334
*/
12961335
name?: string | null;
12971336

1337+
/**
1338+
* **o1 and o3-mini models only**
1339+
*
1340+
* Constrains effort on reasoning for
1341+
* [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
1342+
* supported values are `low`, `medium`, and `high`. Reducing reasoning effort can
1343+
* result in faster responses and fewer tokens used on reasoning in a response.
1344+
*/
1345+
reasoning_effort?: 'low' | 'medium' | 'high' | null;
1346+
12981347
/**
12991348
* Specifies the format that the model must output. Compatible with
13001349
* [GPT-4o](https://platform.openai.com/docs/models#gpt-4o),

src/resources/beta/threads/runs/runs.ts

+10
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,16 @@ export interface RunCreateParamsBase {
731731
*/
732732
parallel_tool_calls?: boolean;
733733

734+
/**
735+
* Body param: **o1 and o3-mini models only**
736+
*
737+
* Constrains effort on reasoning for
738+
* [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
739+
* supported values are `low`, `medium`, and `high`. Reducing reasoning effort can
740+
* result in faster responses and fewer tokens used on reasoning in a response.
741+
*/
742+
reasoning_effort?: 'low' | 'medium' | 'high' | null;
743+
734744
/**
735745
* Body param: Specifies the format that the model must output. Compatible with
736746
* [GPT-4o](https://platform.openai.com/docs/models#gpt-4o),

src/resources/chat/completions.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -744,14 +744,14 @@ export interface ChatCompletionPredictionContent {
744744
}
745745

746746
/**
747-
* **o1 models only**
747+
* **o1 and o3-mini models only**
748748
*
749749
* Constrains effort on reasoning for
750750
* [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
751751
* supported values are `low`, `medium`, and `high`. Reducing reasoning effort can
752752
* result in faster responses and fewer tokens used on reasoning in a response.
753753
*/
754-
export type ChatCompletionReasoningEffort = 'low' | 'medium' | 'high';
754+
export type ChatCompletionReasoningEffort = 'low' | 'medium' | 'high' | null;
755755

756756
/**
757757
* The role of the author of a message
@@ -1063,14 +1063,14 @@ export interface ChatCompletionCreateParamsBase {
10631063
presence_penalty?: number | null;
10641064

10651065
/**
1066-
* **o1 models only**
1066+
* **o1 and o3-mini models only**
10671067
*
10681068
* Constrains effort on reasoning for
10691069
* [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
10701070
* supported values are `low`, `medium`, and `high`. Reducing reasoning effort can
10711071
* result in faster responses and fewer tokens used on reasoning in a response.
10721072
*/
1073-
reasoning_effort?: ChatCompletionReasoningEffort;
1073+
reasoning_effort?: ChatCompletionReasoningEffort | null;
10741074

10751075
/**
10761076
* An object specifying the format that the model must output.

tests/api-resources/beta/assistants.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ describe('resource assistants', () => {
2727
instructions: 'instructions',
2828
metadata: { foo: 'string' },
2929
name: 'name',
30+
reasoning_effort: 'low',
3031
response_format: 'auto',
3132
temperature: 1,
3233
tool_resources: {

tests/api-resources/beta/threads/runs/runs.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ describe('resource runs', () => {
3939
metadata: { foo: 'string' },
4040
model: 'gpt-4o',
4141
parallel_tool_calls: true,
42+
reasoning_effort: 'low',
4243
response_format: 'auto',
4344
stream: false,
4445
temperature: 1,

0 commit comments

Comments
 (0)