@@ -2104,20 +2104,32 @@ pub struct ResponseMetadata {
21042104
21052105/// Output item
21062106#[ derive( Debug , Serialize , Deserialize , Clone , PartialEq ) ]
2107+ #[ serde( tag = "type" ) ]
2108+ #[ serde( rename_all = "snake_case" ) ]
21072109#[ non_exhaustive]
2108- pub struct OutputItem {
2110+ pub enum OutputItem {
2111+ Message ( OutputMessage ) ,
2112+ FileSearchCall ( FileSearchCallOutput ) ,
2113+ FunctionCall ( FunctionCall ) ,
2114+ WebSearchCall ( WebSearchCallOutput ) ,
2115+ ComputerCall ( ComputerCallOutput ) ,
2116+ Reasoning ( ReasoningItem ) ,
2117+ ImageGenerationCall ( ImageGenerationCallOutput ) ,
2118+ CodeInterpreterCall ( CodeInterpreterCallOutput ) ,
2119+ LocalShellCall ( LocalShellCallOutput ) ,
2120+ McpCall ( McpCallOutput ) ,
2121+ McpListTools ( McpListToolsOutput ) ,
2122+ McpApprovalRequest ( McpApprovalRequestOutput ) ,
2123+ CustomToolCall ( CustomToolCallOutput ) ,
2124+ }
2125+
2126+ #[ derive( Debug , Serialize , Deserialize , Clone , PartialEq ) ]
2127+ #[ non_exhaustive]
2128+ pub struct CustomToolCallOutput {
2129+ pub call_id : String ,
2130+ pub input : String ,
2131+ pub name : String ,
21092132 pub id : String ,
2110- #[ serde( rename = "type" ) ]
2111- pub item_type : String ,
2112- #[ serde( skip_serializing_if = "Option::is_none" ) ]
2113- pub status : Option < String > ,
2114- #[ serde( skip_serializing_if = "Option::is_none" ) ]
2115- pub content : Option < Vec < ContentPart > > ,
2116- #[ serde( skip_serializing_if = "Option::is_none" ) ]
2117- pub role : Option < String > ,
2118- /// For reasoning items - summary paragraphs
2119- #[ serde( skip_serializing_if = "Option::is_none" ) ]
2120- pub summary : Option < Vec < serde_json:: Value > > ,
21212133}
21222134
21232135/// Content part
0 commit comments