@@ -36,6 +36,10 @@ pub enum ResponseTool {
3636 #[ serde( rename = "code_interpreter" ) ]
3737 CodeInterpreter ( CodeInterpreterTool ) ,
3838
39+ /// Built-in tool.
40+ #[ serde( rename = "image_generation" ) ]
41+ ImageGeneration ( ImageGenerationTool ) ,
42+
3943 /// MCP server tool.
4044 #[ serde( rename = "mcp" ) ]
4145 Mcp ( McpTool ) ,
@@ -80,6 +84,17 @@ pub struct CodeInterpreterTool {
8084 pub container : Option < Value > ,
8185}
8286
87+ /// Built-in image generation tool.
88+ ///
89+ /// The upstream API may add optional fields over time. We keep this tool shape
90+ /// open by preserving unknown key/value pairs.
91+ #[ serde_with:: skip_serializing_none]
92+ #[ derive( Debug , Clone , Deserialize , Serialize , Default , schemars:: JsonSchema ) ]
93+ pub struct ImageGenerationTool {
94+ #[ serde( flatten) ]
95+ pub options : HashMap < String , Value > ,
96+ }
97+
8398/// `require_approval` values.
8499#[ derive( Debug , Clone , Deserialize , Serialize , PartialEq , Eq , schemars:: JsonSchema ) ]
85100#[ serde( rename_all = "snake_case" ) ]
@@ -314,6 +329,13 @@ pub enum ResponseOutputItem {
314329 queries : Vec < String > ,
315330 results : Option < Vec < FileSearchResult > > ,
316331 } ,
332+ #[ serde( rename = "image_generation_call" ) ]
333+ ImageGenerationCall {
334+ id : String ,
335+ status : ImageGenerationCallStatus ,
336+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
337+ result : Option < String > ,
338+ } ,
317339}
318340
319341// ============================================================================
@@ -389,6 +411,17 @@ pub enum FileSearchCallStatus {
389411 Failed ,
390412}
391413
414+ /// Status for image generation tool calls.
415+ #[ derive( Debug , Clone , Deserialize , Serialize , PartialEq , schemars:: JsonSchema ) ]
416+ #[ serde( rename_all = "snake_case" ) ]
417+ pub enum ImageGenerationCallStatus {
418+ InProgress ,
419+ Generating ,
420+ Completed ,
421+ Incomplete ,
422+ Failed ,
423+ }
424+
392425/// A result from file search.
393426#[ serde_with:: skip_serializing_none]
394427#[ derive( Debug , Clone , Deserialize , Serialize , schemars:: JsonSchema ) ]
0 commit comments