Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 24 additions & 12 deletions async-openai/src/types/responses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2104,20 +2104,32 @@ pub struct ResponseMetadata {

/// Output item
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
#[serde(tag = "type")]
#[serde(rename_all = "snake_case")]
#[non_exhaustive]
pub struct OutputItem {
pub enum OutputItem {
Message(OutputMessage),
FileSearchCall(FileSearchCallOutput),
FunctionCall(FunctionCall),
WebSearchCall(WebSearchCallOutput),
ComputerCall(ComputerCallOutput),
Reasoning(ReasoningItem),
ImageGenerationCall(ImageGenerationCallOutput),
CodeInterpreterCall(CodeInterpreterCallOutput),
LocalShellCall(LocalShellCallOutput),
McpCall(McpCallOutput),
McpListTools(McpListToolsOutput),
McpApprovalRequest(McpApprovalRequestOutput),
CustomToolCall(CustomToolCallOutput),
}

#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
#[non_exhaustive]
pub struct CustomToolCallOutput {
pub call_id: String,
pub input: String,
pub name: String,
pub id: String,
#[serde(rename = "type")]
pub item_type: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub content: Option<Vec<ContentPart>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub role: Option<String>,
/// For reasoning items - summary paragraphs
#[serde(skip_serializing_if = "Option::is_none")]
pub summary: Option<Vec<serde_json::Value>>,
}

/// Content part
Expand Down