Skip to content

Commit 4cec09d

Browse files
stainless-botRobertCraigie
authored andcommitted
fix(api): add missing reasoning effort + model enums
1 parent d99b497 commit 4cec09d

File tree

6 files changed

+67
-6
lines changed

6 files changed

+67
-6
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: 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

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1123,6 +1123,16 @@ export interface AssistantCreateParams {
11231123
*/
11241124
name?: string | null;
11251125

1126+
/**
1127+
* **o1 and o3-mini models only**
1128+
*
1129+
* Constrains effort on reasoning for
1130+
* [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
1131+
* supported values are `low`, `medium`, and `high`. Reducing reasoning effort can
1132+
* result in faster responses and fewer tokens used on reasoning in a response.
1133+
*/
1134+
reasoning_effort?: 'low' | 'medium' | 'high' | null;
1135+
11261136
/**
11271137
* Specifies the format that the model must output. Compatible with
11281138
* [GPT-4o](https://platform.openai.com/docs/models#gpt-4o),
@@ -1278,13 +1288,52 @@ export interface AssistantUpdateParams {
12781288
* [Model overview](https://platform.openai.com/docs/models) for descriptions of
12791289
* them.
12801290
*/
1281-
model?: string;
1291+
model?:
1292+
| (string & {})
1293+
| 'o3-mini'
1294+
| 'o3-mini-2025-01-31'
1295+
| 'o1'
1296+
| 'o1-2024-12-17'
1297+
| 'gpt-4o'
1298+
| 'gpt-4o-2024-11-20'
1299+
| 'gpt-4o-2024-08-06'
1300+
| 'gpt-4o-2024-05-13'
1301+
| 'gpt-4o-mini'
1302+
| 'gpt-4o-mini-2024-07-18'
1303+
| 'gpt-4-turbo'
1304+
| 'gpt-4-turbo-2024-04-09'
1305+
| 'gpt-4-0125-preview'
1306+
| 'gpt-4-turbo-preview'
1307+
| 'gpt-4-1106-preview'
1308+
| 'gpt-4-vision-preview'
1309+
| 'gpt-4'
1310+
| 'gpt-4-0314'
1311+
| 'gpt-4-0613'
1312+
| 'gpt-4-32k'
1313+
| 'gpt-4-32k-0314'
1314+
| 'gpt-4-32k-0613'
1315+
| 'gpt-3.5-turbo'
1316+
| 'gpt-3.5-turbo-16k'
1317+
| 'gpt-3.5-turbo-0613'
1318+
| 'gpt-3.5-turbo-1106'
1319+
| 'gpt-3.5-turbo-0125'
1320+
| 'gpt-3.5-turbo-16k-0613';
12821321

12831322
/**
12841323
* The name of the assistant. The maximum length is 256 characters.
12851324
*/
12861325
name?: string | null;
12871326

1327+
/**
1328+
* **o1 and o3-mini models only**
1329+
*
1330+
* Constrains effort on reasoning for
1331+
* [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
1332+
* supported values are `low`, `medium`, and `high`. Reducing reasoning effort can
1333+
* result in faster responses and fewer tokens used on reasoning in a response.
1334+
*/
1335+
reasoning_effort?: 'low' | 'medium' | 'high' | null;
1336+
12881337
/**
12891338
* Specifies the format that the model must output. Compatible with
12901339
* [GPT-4o](https://platform.openai.com/docs/models#gpt-4o),

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,16 @@ export interface RunCreateParamsBase {
708708
*/
709709
parallel_tool_calls?: boolean;
710710

711+
/**
712+
* Body param: **o1 and o3-mini models only**
713+
*
714+
* Constrains effort on reasoning for
715+
* [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
716+
* supported values are `low`, `medium`, and `high`. Reducing reasoning effort can
717+
* result in faster responses and fewer tokens used on reasoning in a response.
718+
*/
719+
reasoning_effort?: 'low' | 'medium' | 'high' | null;
720+
711721
/**
712722
* Body param: Specifies the format that the model must output. Compatible with
713723
* [GPT-4o](https://platform.openai.com/docs/models#gpt-4o),

src/resources/chat/completions.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -741,14 +741,14 @@ export interface ChatCompletionPredictionContent {
741741
}
742742

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

753753
/**
754754
* The role of the author of a message
@@ -1055,14 +1055,14 @@ export interface ChatCompletionCreateParamsBase {
10551055
presence_penalty?: number | null;
10561056

10571057
/**
1058-
* **o1 models only**
1058+
* **o1 and o3-mini models only**
10591059
*
10601060
* Constrains effort on reasoning for
10611061
* [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
10621062
* supported values are `low`, `medium`, and `high`. Reducing reasoning effort can
10631063
* result in faster responses and fewer tokens used on reasoning in a response.
10641064
*/
1065-
reasoning_effort?: ChatCompletionReasoningEffort;
1065+
reasoning_effort?: ChatCompletionReasoningEffort | null;
10661066

10671067
/**
10681068
* An object specifying the format that the model must output.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ describe('resource assistants', () => {
2626
instructions: 'instructions',
2727
metadata: { foo: 'string' },
2828
name: 'name',
29+
reasoning_effort: 'low',
2930
response_format: 'auto',
3031
temperature: 1,
3132
tool_resources: {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ describe('resource runs', () => {
3838
metadata: { foo: 'string' },
3939
model: 'gpt-4o',
4040
parallel_tool_calls: true,
41+
reasoning_effort: 'low',
4142
response_format: 'auto',
4243
stream: false,
4344
temperature: 1,

0 commit comments

Comments
 (0)