Skip to content

Commit 8ea3fd6

Browse files
committed
fix Responses ReasoningItem
1 parent 3aaea4a commit 8ea3fd6

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

async-openai/src/types/responses/response.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1667,7 +1667,7 @@ pub struct ReasoningItem {
16671667
/// Unique identifier of the reasoning content.
16681668
pub id: String,
16691669
/// Reasoning summary content.
1670-
pub summary: Vec<Summary>,
1670+
pub summary: Vec<SummaryPart>,
16711671
/// Reasoning text content.
16721672
#[serde(skip_serializing_if = "Option::is_none")]
16731673
pub content: Option<Vec<ReasoningTextContent>>,
@@ -1688,6 +1688,12 @@ pub struct Summary {
16881688
pub text: String,
16891689
}
16901690

1691+
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
1692+
#[serde(tag = "type", rename_all = "snake_case")]
1693+
pub enum SummaryPart {
1694+
SummaryText(Summary),
1695+
}
1696+
16911697
/// File search tool call output.
16921698
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
16931699
pub struct FileSearchToolCall {

async-openai/src/types/responses/stream.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::pin::Pin;
44

55
use crate::{
66
error::OpenAIError,
7-
types::responses::{OutputContent, OutputItem, Response, ResponseLogProb, Summary},
7+
types::responses::{OutputContent, OutputItem, Response, ResponseLogProb, SummaryPart},
88
};
99

1010
/// Stream of response events
@@ -324,12 +324,6 @@ pub struct ResponseWebSearchCallCompletedEvent {
324324
pub item_id: String,
325325
}
326326

327-
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
328-
#[serde(tag = "type", rename_all = "snake_case")]
329-
pub enum SummaryPart {
330-
SummaryText(Summary),
331-
}
332-
333327
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
334328
pub struct ResponseReasoningSummaryPartAddedEvent {
335329
pub sequence_number: u64,

0 commit comments

Comments
 (0)