mirror of
https://github.com/openai/codex.git
synced 2026-04-24 22:54:54 +00:00
Support end_turn flag (#9698)
Experimental flag that signals the end of the turn.
This commit is contained in:
@@ -80,6 +80,10 @@ pub enum ResponseItem {
|
||||
id: Option<String>,
|
||||
role: String,
|
||||
content: Vec<ContentItem>,
|
||||
// Do not use directly, no available consistently across all providers.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional)]
|
||||
end_turn: Option<bool>,
|
||||
},
|
||||
Reasoning {
|
||||
#[serde(default, skip_serializing)]
|
||||
@@ -328,6 +332,7 @@ impl From<DeveloperInstructions> for ResponseItem {
|
||||
content: vec![ContentItem::InputText {
|
||||
text: di.into_text(),
|
||||
}],
|
||||
end_turn: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -497,6 +502,7 @@ impl From<ResponseInputItem> for ResponseItem {
|
||||
role,
|
||||
content,
|
||||
id: None,
|
||||
end_turn: None,
|
||||
},
|
||||
ResponseInputItem::FunctionCallOutput { call_id, output } => {
|
||||
Self::FunctionCallOutput { call_id, output }
|
||||
|
||||
@@ -1607,6 +1607,7 @@ impl From<CompactedItem> for ResponseItem {
|
||||
content: vec![ContentItem::OutputText {
|
||||
text: value.message,
|
||||
}],
|
||||
end_turn: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user