Skip to content

Commit d296d85

Browse files
feat(api): add reasoning_text
1 parent 8260288 commit d296d85

File tree

7 files changed

+46
-12
lines changed

7 files changed

+46
-12
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/openai/types/conversations/message.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,24 @@
1414
from ..responses.response_output_text import ResponseOutputText
1515
from ..responses.response_output_refusal import ResponseOutputRefusal
1616

17-
__all__ = ["Message", "Content"]
17+
__all__ = ["Message", "Content", "ContentReasoningText"]
18+
19+
20+
class ContentReasoningText(BaseModel):
21+
text: str
22+
"""The reasoning text from the model."""
23+
24+
type: Literal["reasoning_text"]
25+
"""The type of the reasoning text. Always `reasoning_text`."""
26+
1827

1928
Content: TypeAlias = Annotated[
2029
Union[
2130
ResponseInputText,
2231
ResponseOutputText,
2332
TextContent,
2433
SummaryTextContent,
34+
ContentReasoningText,
2535
ResponseOutputRefusal,
2636
ResponseInputImage,
2737
ComputerScreenshotContent,

src/openai/types/conversations/summary_text_content.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@
99

1010
class SummaryTextContent(BaseModel):
1111
text: str
12+
"""A summary of the reasoning output from the model so far."""
1213

1314
type: Literal["summary_text"]
15+
"""The type of the object. Always `summary_text`."""

src/openai/types/responses/response_content_part_added_event.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,20 @@
88
from .response_output_text import ResponseOutputText
99
from .response_output_refusal import ResponseOutputRefusal
1010

11-
__all__ = ["ResponseContentPartAddedEvent", "Part"]
11+
__all__ = ["ResponseContentPartAddedEvent", "Part", "PartReasoningText"]
1212

13-
Part: TypeAlias = Annotated[Union[ResponseOutputText, ResponseOutputRefusal], PropertyInfo(discriminator="type")]
13+
14+
class PartReasoningText(BaseModel):
15+
text: str
16+
"""The reasoning text from the model."""
17+
18+
type: Literal["reasoning_text"]
19+
"""The type of the reasoning text. Always `reasoning_text`."""
20+
21+
22+
Part: TypeAlias = Annotated[
23+
Union[ResponseOutputText, ResponseOutputRefusal, PartReasoningText], PropertyInfo(discriminator="type")
24+
]
1425

1526

1627
class ResponseContentPartAddedEvent(BaseModel):

src/openai/types/responses/response_content_part_done_event.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,20 @@
88
from .response_output_text import ResponseOutputText
99
from .response_output_refusal import ResponseOutputRefusal
1010

11-
__all__ = ["ResponseContentPartDoneEvent", "Part"]
11+
__all__ = ["ResponseContentPartDoneEvent", "Part", "PartReasoningText"]
1212

13-
Part: TypeAlias = Annotated[Union[ResponseOutputText, ResponseOutputRefusal], PropertyInfo(discriminator="type")]
13+
14+
class PartReasoningText(BaseModel):
15+
text: str
16+
"""The reasoning text from the model."""
17+
18+
type: Literal["reasoning_text"]
19+
"""The type of the reasoning text. Always `reasoning_text`."""
20+
21+
22+
Part: TypeAlias = Annotated[
23+
Union[ResponseOutputText, ResponseOutputRefusal, PartReasoningText], PropertyInfo(discriminator="type")
24+
]
1425

1526

1627
class ResponseContentPartDoneEvent(BaseModel):

src/openai/types/responses/response_reasoning_item.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ class Summary(BaseModel):
1818

1919
class Content(BaseModel):
2020
text: str
21-
"""Reasoning text output from the model."""
21+
"""The reasoning text from the model."""
2222

2323
type: Literal["reasoning_text"]
24-
"""The type of the object. Always `reasoning_text`."""
24+
"""The type of the reasoning text. Always `reasoning_text`."""
2525

2626

2727
class ResponseReasoningItem(BaseModel):

src/openai/types/responses/response_reasoning_item_param.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ class Summary(TypedDict, total=False):
1818

1919
class Content(TypedDict, total=False):
2020
text: Required[str]
21-
"""Reasoning text output from the model."""
21+
"""The reasoning text from the model."""
2222

2323
type: Required[Literal["reasoning_text"]]
24-
"""The type of the object. Always `reasoning_text`."""
24+
"""The type of the reasoning text. Always `reasoning_text`."""
2525

2626

2727
class ResponseReasoningItemParam(TypedDict, total=False):

0 commit comments

Comments
 (0)