pub enum ResponseItem {
Message(Message),
Reasoning(Reasoning),
FunctionCall(FunctionCall),
FunctionCallOutput(FunctionCallOutput),
CustomToolCall(CustomToolCall),
CustomToolCallOutput(CustomToolCallOutput),
Other {
kind: String,
payload: Value,
},
}Expand description
Items emitted by the model — messages, reasoning, and tool calls.
Codex’s upstream enum has more variants (LocalShellCall,
WebSearchCall, ImageGenerationCall, etc.). We strongly-type
the ones we see in the wild and leave the rest as raw Value via
ResponseItem::Other. This keeps the crate future-proof: a new
variant we don’t handle still round-trips losslessly.
Variants§
Message(Message)
Reasoning(Reasoning)
FunctionCall(FunctionCall)
FunctionCallOutput(FunctionCallOutput)
CustomToolCall(CustomToolCall)
CustomToolCallOutput(CustomToolCallOutput)
Other
Implementations§
Source§impl ResponseItem
impl ResponseItem
Sourcepub fn from_value(payload: &Value) -> Self
pub fn from_value(payload: &Value) -> Self
Dispatch on the inner type field.
Trait Implementations§
Source§impl Clone for ResponseItem
impl Clone for ResponseItem
Source§fn clone(&self) -> ResponseItem
fn clone(&self) -> ResponseItem
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ResponseItem
impl RefUnwindSafe for ResponseItem
impl Send for ResponseItem
impl Sync for ResponseItem
impl Unpin for ResponseItem
impl UnsafeUnpin for ResponseItem
impl UnwindSafe for ResponseItem
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more