pub enum ResponseItem {
Message {
role: String,
content: Vec<ContentBlock>,
extra: ExtraFields,
},
FunctionCall {
name: String,
arguments: String,
call_id: String,
extra: ExtraFields,
},
FunctionCallOutput {
call_id: String,
output: Value,
extra: ExtraFields,
},
CustomToolCall {
name: Option<String>,
input: Value,
call_id: Option<String>,
extra: ExtraFields,
},
CustomToolCallOutput {
call_id: Option<String>,
output: Value,
extra: ExtraFields,
},
Reasoning {
extra: ExtraFields,
},
WebSearchCall {
extra: ExtraFields,
},
ToolSearchCall {
extra: ExtraFields,
},
ToolSearchOutput {
extra: ExtraFields,
},
ImageGenerationCall {
extra: ExtraFields,
},
Unknown,
}Expand description
A canonical conversation item (response_item payload).
Variants§
Message
A chat message turn.
FunctionCall
A built-in function (tool) call.
Fields
extra: ExtraFieldsAnything else.
FunctionCallOutput
The output of a function call.
Fields
extra: ExtraFieldsAnything else.
CustomToolCall
A custom / MCP tool call. Not yet normalized by the loader.
Fields
extra: ExtraFieldsAnything else.
CustomToolCallOutput
A custom / MCP tool result. Not yet normalized by the loader.
Fields
extra: ExtraFieldsAnything else.
Reasoning
Model reasoning. Not folded 1:1 into a ChatMessage (there’s no
canonical “reasoning” role), but summary text, the raw content
chain-of-thought text when genuinely non-null, and a correctly-gated
encrypted_content flag (only when that field is non-null — a
present-but-null key, which every real rollout carries, must NOT
set the flag) ARE captured by
crate::session::Session::from_codex_str onto the next assistant
message’s metadata (reasoning/reasoning_content/
reasoning_encrypted), or flushed as their own message when no
following assistant turn exists to attach to — see
crate::audit::Coverage::Retained (D5/N1/N2/N3, PARITY-12). The
opaque encrypted_content blob itself is not replayed cross-model.
Fields
extra: ExtraFieldsAnything (summary, encrypted_content, …).
WebSearchCall
A web-search server tool call. Not yet normalized.
Fields
extra: ExtraFieldsAnything.
ToolSearchCall
A tool-search call. Not yet normalized.
Fields
extra: ExtraFieldsAnything.
ToolSearchOutput
A tool-search result. Not yet normalized.
Fields
extra: ExtraFieldsAnything.
ImageGenerationCall
An image-generation call. Not yet normalized.
Fields
extra: ExtraFieldsAnything.
Unknown
Any response-item type we do not model yet.
Implementations§
Source§impl ResponseItem
impl ResponseItem
Sourcepub fn tag(&self) -> Option<&'static str>
pub fn tag(&self) -> Option<&'static str>
The static discriminant name, or None for ResponseItem::Unknown.
Sourcepub fn is_normalized(&self) -> bool
pub fn is_normalized(&self) -> bool
Whether the loader currently normalizes this item into a crate::ChatMessage.
Trait Implementations§
Source§impl Clone for ResponseItem
impl Clone for ResponseItem
Source§fn clone(&self) -> ResponseItem
fn clone(&self) -> ResponseItem
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more