mirror of
https://github.com/openai/codex.git
synced 2026-04-29 00:55:38 +00:00
Enabling CWD Saving for Image-Gen (#13607)
Codex now saves the generated image on to your current working directory.
This commit is contained in:
@@ -1901,6 +1901,9 @@ pub struct ImageGenerationEndEvent {
|
||||
#[ts(optional)]
|
||||
pub revised_prompt: Option<String>,
|
||||
pub result: String,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
pub saved_path: Option<String>,
|
||||
}
|
||||
|
||||
// Conversation kept for backward compatibility.
|
||||
@@ -3274,6 +3277,7 @@ mod tests {
|
||||
status: "in_progress".into(),
|
||||
revised_prompt: None,
|
||||
result: String::new(),
|
||||
saved_path: None,
|
||||
}),
|
||||
};
|
||||
|
||||
@@ -3295,6 +3299,7 @@ mod tests {
|
||||
status: "completed".into(),
|
||||
revised_prompt: Some("A tiny blue square".into()),
|
||||
result: "Zm9v".into(),
|
||||
saved_path: Some("/tmp/ig-1.png".into()),
|
||||
}),
|
||||
};
|
||||
|
||||
@@ -3306,6 +3311,7 @@ mod tests {
|
||||
assert_eq!(event.status, "completed");
|
||||
assert_eq!(event.revised_prompt.as_deref(), Some("A tiny blue square"));
|
||||
assert_eq!(event.result, "Zm9v");
|
||||
assert_eq!(event.saved_path.as_deref(), Some("/tmp/ig-1.png"));
|
||||
}
|
||||
_ => panic!("expected ImageGenerationEnd event"),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user