Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 32efcf3

Browse filesBrowse files
fix(responses): correct reasoning output type (#2181)
1 parent 559af75 commit 32efcf3
Copy full SHA for 32efcf3

File tree

Expand file treeCollapse file tree

8 files changed

+85
-97
lines changed
Filter options
Expand file treeCollapse file tree

8 files changed

+85
-97
lines changed

‎.stats.yml

Copy file name to clipboard
+1-1Lines changed: 1 addition & 1 deletion
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

Copy file name to clipboardExpand all lines: api.md
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,7 @@ from openai.types.responses import (
624624
ResponseOutputMessage,
625625
ResponseOutputRefusal,
626626
ResponseOutputText,
627+
ResponseReasoningItem,
627628
ResponseRefusalDeltaEvent,
628629
ResponseRefusalDoneEvent,
629630
ResponseStatus,

‎src/openai/types/responses/__init__.py

Copy file name to clipboardExpand all lines: src/openai/types/responses/__init__.py
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
from .response_input_content import ResponseInputContent as ResponseInputContent
3838
from .response_output_message import ResponseOutputMessage as ResponseOutputMessage
3939
from .response_output_refusal import ResponseOutputRefusal as ResponseOutputRefusal
40+
from .response_reasoning_item import ResponseReasoningItem as ResponseReasoningItem
4041
from .tool_choice_types_param import ToolChoiceTypesParam as ToolChoiceTypesParam
4142
from .easy_input_message_param import EasyInputMessageParam as EasyInputMessageParam
4243
from .response_completed_event import ResponseCompletedEvent as ResponseCompletedEvent
@@ -63,6 +64,7 @@
6364
from .response_refusal_delta_event import ResponseRefusalDeltaEvent as ResponseRefusalDeltaEvent
6465
from .response_output_message_param import ResponseOutputMessageParam as ResponseOutputMessageParam
6566
from .response_output_refusal_param import ResponseOutputRefusalParam as ResponseOutputRefusalParam
67+
from .response_reasoning_item_param import ResponseReasoningItemParam as ResponseReasoningItemParam
6668
from .response_file_search_tool_call import ResponseFileSearchToolCall as ResponseFileSearchToolCall
6769
from .response_output_item_done_event import ResponseOutputItemDoneEvent as ResponseOutputItemDoneEvent
6870
from .response_content_part_done_event import ResponseContentPartDoneEvent as ResponseContentPartDoneEvent

‎src/openai/types/responses/response_input_item_param.py

Copy file name to clipboardExpand all lines: src/openai/types/responses/response_input_item_param.py
+2-31Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
from .easy_input_message_param import EasyInputMessageParam
99
from .response_output_message_param import ResponseOutputMessageParam
10+
from .response_reasoning_item_param import ResponseReasoningItemParam
1011
from .response_computer_tool_call_param import ResponseComputerToolCallParam
1112
from .response_function_tool_call_param import ResponseFunctionToolCallParam
1213
from .response_function_web_search_param import ResponseFunctionWebSearchParam
@@ -20,8 +21,6 @@
2021
"ComputerCallOutputOutput",
2122
"ComputerCallOutputAcknowledgedSafetyCheck",
2223
"FunctionCallOutput",
23-
"Reasoning",
24-
"ReasoningContent",
2524
"ItemReference",
2625
]
2726

@@ -123,34 +122,6 @@ class FunctionCallOutput(TypedDict, total=False):
123122
"""
124123

125124

126-
class ReasoningContent(TypedDict, total=False):
127-
text: Required[str]
128-
"""
129-
A short summary of the reasoning used by the model when generating the response.
130-
"""
131-
132-
type: Required[Literal["reasoning_summary"]]
133-
"""The type of the object. Always `text`."""
134-
135-
136-
class Reasoning(TypedDict, total=False):
137-
id: Required[str]
138-
"""The unique identifier of the reasoning content."""
139-
140-
content: Required[Iterable[ReasoningContent]]
141-
"""Reasoning text contents."""
142-
143-
type: Required[Literal["reasoning"]]
144-
"""The type of the object. Always `reasoning`."""
145-
146-
status: Literal["in_progress", "completed", "incomplete"]
147-
"""The status of the item.
148-
149-
One of `in_progress`, `completed`, or `incomplete`. Populated when items are
150-
returned via API.
151-
"""
152-
153-
154125
class ItemReference(TypedDict, total=False):
155126
id: Required[str]
156127
"""The ID of the item to reference."""
@@ -169,6 +140,6 @@ class ItemReference(TypedDict, total=False):
169140
ResponseFunctionWebSearchParam,
170141
ResponseFunctionToolCallParam,
171142
FunctionCallOutput,
172-
Reasoning,
143+
ResponseReasoningItemParam,
173144
ItemReference,
174145
]

‎src/openai/types/responses/response_input_param.py

Copy file name to clipboardExpand all lines: src/openai/types/responses/response_input_param.py
+2-31Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
from .easy_input_message_param import EasyInputMessageParam
99
from .response_output_message_param import ResponseOutputMessageParam
10+
from .response_reasoning_item_param import ResponseReasoningItemParam
1011
from .response_computer_tool_call_param import ResponseComputerToolCallParam
1112
from .response_function_tool_call_param import ResponseFunctionToolCallParam
1213
from .response_function_web_search_param import ResponseFunctionWebSearchParam
@@ -21,8 +22,6 @@
2122
"ComputerCallOutputOutput",
2223
"ComputerCallOutputAcknowledgedSafetyCheck",
2324
"FunctionCallOutput",
24-
"Reasoning",
25-
"ReasoningContent",
2625
"ItemReference",
2726
]
2827

@@ -124,34 +123,6 @@ class FunctionCallOutput(TypedDict, total=False):
124123
"""
125124

126125

127-
class ReasoningContent(TypedDict, total=False):
128-
text: Required[str]
129-
"""
130-
A short summary of the reasoning used by the model when generating the response.
131-
"""
132-
133-
type: Required[Literal["reasoning_summary"]]
134-
"""The type of the object. Always `text`."""
135-
136-
137-
class Reasoning(TypedDict, total=False):
138-
id: Required[str]
139-
"""The unique identifier of the reasoning content."""
140-
141-
content: Required[Iterable[ReasoningContent]]
142-
"""Reasoning text contents."""
143-
144-
type: Required[Literal["reasoning"]]
145-
"""The type of the object. Always `reasoning`."""
146-
147-
status: Literal["in_progress", "completed", "incomplete"]
148-
"""The status of the item.
149-
150-
One of `in_progress`, `completed`, or `incomplete`. Populated when items are
151-
returned via API.
152-
"""
153-
154-
155126
class ItemReference(TypedDict, total=False):
156127
id: Required[str]
157128
"""The ID of the item to reference."""
@@ -170,7 +141,7 @@ class ItemReference(TypedDict, total=False):
170141
ResponseFunctionWebSearchParam,
171142
ResponseFunctionToolCallParam,
172143
FunctionCallOutput,
173-
Reasoning,
144+
ResponseReasoningItemParam,
174145
ItemReference,
175146
]
176147

+5-34Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,17 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import List, Union, Optional
4-
from typing_extensions import Literal, Annotated, TypeAlias
3+
from typing import Union
4+
from typing_extensions import Annotated, TypeAlias
55

66
from ..._utils import PropertyInfo
7-
from ..._models import BaseModel
87
from .response_output_message import ResponseOutputMessage
8+
from .response_reasoning_item import ResponseReasoningItem
99
from .response_computer_tool_call import ResponseComputerToolCall
1010
from .response_function_tool_call import ResponseFunctionToolCall
1111
from .response_function_web_search import ResponseFunctionWebSearch
1212
from .response_file_search_tool_call import ResponseFileSearchToolCall
1313

14-
__all__ = ["ResponseOutputItem", "Reasoning", "ReasoningContent"]
15-
16-
17-
class ReasoningContent(BaseModel):
18-
text: str
19-
"""
20-
A short summary of the reasoning used by the model when generating the response.
21-
"""
22-
23-
type: Literal["reasoning_summary"]
24-
"""The type of the object. Always `text`."""
25-
26-
27-
class Reasoning(BaseModel):
28-
id: str
29-
"""The unique identifier of the reasoning content."""
30-
31-
content: List[ReasoningContent]
32-
"""Reasoning text contents."""
33-
34-
type: Literal["reasoning"]
35-
"""The type of the object. Always `reasoning`."""
36-
37-
status: Optional[Literal["in_progress", "completed", "incomplete"]] = None
38-
"""The status of the item.
39-
40-
One of `in_progress`, `completed`, or `incomplete`. Populated when items are
41-
returned via API.
42-
"""
43-
14+
__all__ = ["ResponseOutputItem"]
4415

4516
ResponseOutputItem: TypeAlias = Annotated[
4617
Union[
@@ -49,7 +20,7 @@ class Reasoning(BaseModel):
4920
ResponseFunctionToolCall,
5021
ResponseFunctionWebSearch,
5122
ResponseComputerToolCall,
52-
Reasoning,
23+
ResponseReasoningItem,
5324
],
5425
PropertyInfo(discriminator="type"),
5526
]
+36Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from typing import List, Optional
4+
from typing_extensions import Literal
5+
6+
from ..._models import BaseModel
7+
8+
__all__ = ["ResponseReasoningItem", "Summary"]
9+
10+
11+
class Summary(BaseModel):
12+
text: str
13+
"""
14+
A short summary of the reasoning used by the model when generating the response.
15+
"""
16+
17+
type: Literal["summary_text"]
18+
"""The type of the object. Always `summary_text`."""
19+
20+
21+
class ResponseReasoningItem(BaseModel):
22+
id: str
23+
"""The unique identifier of the reasoning content."""
24+
25+
summary: List[Summary]
26+
"""Reasoning text contents."""
27+
28+
type: Literal["reasoning"]
29+
"""The type of the object. Always `reasoning`."""
30+
31+
status: Optional[Literal["in_progress", "completed", "incomplete"]] = None
32+
"""The status of the item.
33+
34+
One of `in_progress`, `completed`, or `incomplete`. Populated when items are
35+
returned via API.
36+
"""
+36Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing import Iterable
6+
from typing_extensions import Literal, Required, TypedDict
7+
8+
__all__ = ["ResponseReasoningItemParam", "Summary"]
9+
10+
11+
class Summary(TypedDict, total=False):
12+
text: Required[str]
13+
"""
14+
A short summary of the reasoning used by the model when generating the response.
15+
"""
16+
17+
type: Required[Literal["summary_text"]]
18+
"""The type of the object. Always `summary_text`."""
19+
20+
21+
class ResponseReasoningItemParam(TypedDict, total=False):
22+
id: Required[str]
23+
"""The unique identifier of the reasoning content."""
24+
25+
summary: Required[Iterable[Summary]]
26+
"""Reasoning text contents."""
27+
28+
type: Required[Literal["reasoning"]]
29+
"""The type of the object. Always `reasoning`."""
30+
31+
status: Literal["in_progress", "completed", "incomplete"]
32+
"""The status of the item.
33+
34+
One of `in_progress`, `completed`, or `incomplete`. Populated when items are
35+
returned via API.
36+
"""

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.