Skip to content

Commit 4a1c00a

Browse files
fix(responses): correct reasoning output type (#1373)
1 parent 4921437 commit 4a1c00a

File tree

3 files changed

+45
-87
lines changed

3 files changed

+45
-87
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 81
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-9ce5257763fb30c6e0e1ee2bef7e13baf661511e09572207e528d643da8e16b3.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-c8579861bc21d4d2155a5b9e8e7d54faee8083730673c4d32cbbe573d7fb4116.yml

api.md

+1
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,7 @@ Types:
567567
- <code><a href="./src/resources/responses/responses.ts">ResponseOutputMessage</a></code>
568568
- <code><a href="./src/resources/responses/responses.ts">ResponseOutputRefusal</a></code>
569569
- <code><a href="./src/resources/responses/responses.ts">ResponseOutputText</a></code>
570+
- <code><a href="./src/resources/responses/responses.ts">ResponseReasoningItem</a></code>
570571
- <code><a href="./src/resources/responses/responses.ts">ResponseRefusalDeltaEvent</a></code>
571572
- <code><a href="./src/resources/responses/responses.ts">ResponseRefusalDoneEvent</a></code>
572573
- <code><a href="./src/resources/responses/responses.ts">ResponseStatus</a></code>

src/resources/responses/responses.ts

+43-86
Original file line numberDiff line numberDiff line change
@@ -1498,7 +1498,7 @@ export type ResponseInputItem =
14981498
| ResponseFunctionWebSearch
14991499
| ResponseFunctionToolCall
15001500
| ResponseInputItem.FunctionCallOutput
1501-
| ResponseInputItem.Reasoning
1501+
| ResponseReasoningItem
15021502
| ResponseInputItem.ItemReference;
15031503

15041504
export namespace ResponseInputItem {
@@ -1643,47 +1643,6 @@ export namespace ResponseInputItem {
16431643
status?: 'in_progress' | 'completed' | 'incomplete';
16441644
}
16451645

1646-
/**
1647-
* A description of the chain of thought used by a reasoning model while generating
1648-
* a response.
1649-
*/
1650-
export interface Reasoning {
1651-
/**
1652-
* The unique identifier of the reasoning content.
1653-
*/
1654-
id: string;
1655-
1656-
/**
1657-
* Reasoning text contents.
1658-
*/
1659-
content: Array<Reasoning.Content>;
1660-
1661-
/**
1662-
* The type of the object. Always `reasoning`.
1663-
*/
1664-
type: 'reasoning';
1665-
1666-
/**
1667-
* The status of the item. One of `in_progress`, `completed`, or `incomplete`.
1668-
* Populated when items are returned via API.
1669-
*/
1670-
status?: 'in_progress' | 'completed' | 'incomplete';
1671-
}
1672-
1673-
export namespace Reasoning {
1674-
export interface Content {
1675-
/**
1676-
* A short summary of the reasoning used by the model when generating the response.
1677-
*/
1678-
text: string;
1679-
1680-
/**
1681-
* The type of the object. Always `text`.
1682-
*/
1683-
type: 'reasoning_summary';
1684-
}
1685-
}
1686-
16871646
/**
16881647
* An internal identifier for an item to reference.
16891648
*/
@@ -1750,50 +1709,7 @@ export type ResponseOutputItem =
17501709
| ResponseFunctionToolCall
17511710
| ResponseFunctionWebSearch
17521711
| ResponseComputerToolCall
1753-
| ResponseOutputItem.Reasoning;
1754-
1755-
export namespace ResponseOutputItem {
1756-
/**
1757-
* A description of the chain of thought used by a reasoning model while generating
1758-
* a response.
1759-
*/
1760-
export interface Reasoning {
1761-
/**
1762-
* The unique identifier of the reasoning content.
1763-
*/
1764-
id: string;
1765-
1766-
/**
1767-
* Reasoning text contents.
1768-
*/
1769-
content: Array<Reasoning.Content>;
1770-
1771-
/**
1772-
* The type of the object. Always `reasoning`.
1773-
*/
1774-
type: 'reasoning';
1775-
1776-
/**
1777-
* The status of the item. One of `in_progress`, `completed`, or `incomplete`.
1778-
* Populated when items are returned via API.
1779-
*/
1780-
status?: 'in_progress' | 'completed' | 'incomplete';
1781-
}
1782-
1783-
export namespace Reasoning {
1784-
export interface Content {
1785-
/**
1786-
* A short summary of the reasoning used by the model when generating the response.
1787-
*/
1788-
text: string;
1789-
1790-
/**
1791-
* The type of the object. Always `text`.
1792-
*/
1793-
type: 'reasoning_summary';
1794-
}
1795-
}
1796-
}
1712+
| ResponseReasoningItem;
17971713

17981714
/**
17991715
* Emitted when a new output item is added.
@@ -1975,6 +1891,47 @@ export namespace ResponseOutputText {
19751891
}
19761892
}
19771893

1894+
/**
1895+
* A description of the chain of thought used by a reasoning model while generating
1896+
* a response.
1897+
*/
1898+
export interface ResponseReasoningItem {
1899+
/**
1900+
* The unique identifier of the reasoning content.
1901+
*/
1902+
id: string;
1903+
1904+
/**
1905+
* Reasoning text contents.
1906+
*/
1907+
summary: Array<ResponseReasoningItem.Summary>;
1908+
1909+
/**
1910+
* The type of the object. Always `reasoning`.
1911+
*/
1912+
type: 'reasoning';
1913+
1914+
/**
1915+
* The status of the item. One of `in_progress`, `completed`, or `incomplete`.
1916+
* Populated when items are returned via API.
1917+
*/
1918+
status?: 'in_progress' | 'completed' | 'incomplete';
1919+
}
1920+
1921+
export namespace ResponseReasoningItem {
1922+
export interface Summary {
1923+
/**
1924+
* A short summary of the reasoning used by the model when generating the response.
1925+
*/
1926+
text: string;
1927+
1928+
/**
1929+
* The type of the object. Always `summary_text`.
1930+
*/
1931+
type: 'summary_text';
1932+
}
1933+
}
1934+
19781935
/**
19791936
* Emitted when there is a partial refusal text.
19801937
*/

0 commit comments

Comments
 (0)