Skip to content

Commit f0d3ee1

Browse files
feat(api): add reasoning_text
1 parent 09862bf commit f0d3ee1

File tree

3 files changed

+90
-8
lines changed

3 files changed

+90
-8
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 118
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-380330a93b5d010391ca3b36ea193c5353b0dfdf2ddd02789ef84a84ce427e82.yml
3-
openapi_spec_hash: 859703234259ecdd2a3c6f4de88eb504
4-
config_hash: b619b45c1e7facf819f902dee8fa4f97
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-ea23db36b0899cc715f56d0098956069b2d92880f448adff3a4ac1bb53cb2cec.yml
3+
openapi_spec_hash: 36f76ea31297c9593bcfae453f6255cc
4+
config_hash: 666d6bb4b564f0d9d431124b5d1a0665

src/resources/conversations/conversations.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ export interface Message {
135135
| ResponsesAPI.ResponseOutputText
136136
| TextContent
137137
| SummaryTextContent
138+
| Message.ReasoningText
138139
| ResponsesAPI.ResponseOutputRefusal
139140
| ResponsesAPI.ResponseInputImage
140141
| ComputerScreenshotContent
@@ -159,12 +160,35 @@ export interface Message {
159160
type: 'message';
160161
}
161162

163+
export namespace Message {
164+
/**
165+
* Reasoning text from the model.
166+
*/
167+
export interface ReasoningText {
168+
/**
169+
* The reasoning text from the model.
170+
*/
171+
text: string;
172+
173+
/**
174+
* The type of the reasoning text. Always `reasoning_text`.
175+
*/
176+
type: 'reasoning_text';
177+
}
178+
}
179+
162180
/**
163181
* A summary text from the model.
164182
*/
165183
export interface SummaryTextContent {
184+
/**
185+
* A summary of the reasoning output from the model so far.
186+
*/
166187
text: string;
167188

189+
/**
190+
* The type of the object. Always `summary_text`.
191+
*/
168192
type: 'summary_text';
169193
}
170194

src/resources/responses/responses.ts

Lines changed: 63 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,7 +1282,25 @@ export type ResponseContent =
12821282
| ResponseInputFile
12831283
| ResponseInputAudio
12841284
| ResponseOutputText
1285-
| ResponseOutputRefusal;
1285+
| ResponseOutputRefusal
1286+
| ResponseContent.ReasoningTextContent;
1287+
1288+
export namespace ResponseContent {
1289+
/**
1290+
* Reasoning text from the model.
1291+
*/
1292+
export interface ReasoningTextContent {
1293+
/**
1294+
* The reasoning text from the model.
1295+
*/
1296+
text: string;
1297+
1298+
/**
1299+
* The type of the reasoning text. Always `reasoning_text`.
1300+
*/
1301+
type: 'reasoning_text';
1302+
}
1303+
}
12861304

12871305
/**
12881306
* Emitted when a new content part is added.
@@ -1306,7 +1324,7 @@ export interface ResponseContentPartAddedEvent {
13061324
/**
13071325
* The content part that was added.
13081326
*/
1309-
part: ResponseOutputText | ResponseOutputRefusal;
1327+
part: ResponseOutputText | ResponseOutputRefusal | ResponseContentPartAddedEvent.ReasoningText;
13101328

13111329
/**
13121330
* The sequence number of this event.
@@ -1319,6 +1337,23 @@ export interface ResponseContentPartAddedEvent {
13191337
type: 'response.content_part.added';
13201338
}
13211339

1340+
export namespace ResponseContentPartAddedEvent {
1341+
/**
1342+
* Reasoning text from the model.
1343+
*/
1344+
export interface ReasoningText {
1345+
/**
1346+
* The reasoning text from the model.
1347+
*/
1348+
text: string;
1349+
1350+
/**
1351+
* The type of the reasoning text. Always `reasoning_text`.
1352+
*/
1353+
type: 'reasoning_text';
1354+
}
1355+
}
1356+
13221357
/**
13231358
* Emitted when a content part is done.
13241359
*/
@@ -1341,7 +1376,7 @@ export interface ResponseContentPartDoneEvent {
13411376
/**
13421377
* The content part that is done.
13431378
*/
1344-
part: ResponseOutputText | ResponseOutputRefusal;
1379+
part: ResponseOutputText | ResponseOutputRefusal | ResponseContentPartDoneEvent.ReasoningText;
13451380

13461381
/**
13471382
* The sequence number of this event.
@@ -1354,6 +1389,23 @@ export interface ResponseContentPartDoneEvent {
13541389
type: 'response.content_part.done';
13551390
}
13561391

1392+
export namespace ResponseContentPartDoneEvent {
1393+
/**
1394+
* Reasoning text from the model.
1395+
*/
1396+
export interface ReasoningText {
1397+
/**
1398+
* The reasoning text from the model.
1399+
*/
1400+
text: string;
1401+
1402+
/**
1403+
* The type of the reasoning text. Always `reasoning_text`.
1404+
*/
1405+
type: 'reasoning_text';
1406+
}
1407+
}
1408+
13571409
/**
13581410
* The conversation that this response belongs to.
13591411
*/
@@ -3940,6 +3992,9 @@ export interface ResponseReasoningItem {
39403992
}
39413993

39423994
export namespace ResponseReasoningItem {
3995+
/**
3996+
* A summary text from the model.
3997+
*/
39433998
export interface Summary {
39443999
/**
39454000
* A summary of the reasoning output from the model so far.
@@ -3952,14 +4007,17 @@ export namespace ResponseReasoningItem {
39524007
type: 'summary_text';
39534008
}
39544009

4010+
/**
4011+
* Reasoning text from the model.
4012+
*/
39554013
export interface Content {
39564014
/**
3957-
* Reasoning text output from the model.
4015+
* The reasoning text from the model.
39584016
*/
39594017
text: string;
39604018

39614019
/**
3962-
* The type of the object. Always `reasoning_text`.
4020+
* The type of the reasoning text. Always `reasoning_text`.
39634021
*/
39644022
type: 'reasoning_text';
39654023
}

0 commit comments

Comments
 (0)