pub enum InputItem {
Known(KnownInputItem),
Other(Value),
}Expand description
One item in the input list, mirroring ResponseInputItemParam.
Unrecognized type values deserialize into InputItem::Other and
round-trip without data loss (object key order is normalized through
serde_json::Value, but no field is dropped), so exotic item types
(computer_use, shell, apply_patch, skills, MCP, compaction, …) survive
a decode/encode cycle.
Variants§
Implementations§
Source§impl InputItem
impl InputItem
Sourcepub fn user(content: impl Into<EasyContent>) -> Self
pub fn user(content: impl Into<EasyContent>) -> Self
A user message with plain text or multimodal content.
Sourcepub fn message(role: impl Into<String>, content: impl Into<EasyContent>) -> Self
pub fn message(role: impl Into<String>, content: impl Into<EasyContent>) -> Self
A system/developer/assistant message with plain text or multimodal content.
Sourcepub fn function_call(
call_id: impl Into<String>,
name: impl Into<String>,
arguments: impl Into<String>,
) -> Self
pub fn function_call( call_id: impl Into<String>, name: impl Into<String>, arguments: impl Into<String>, ) -> Self
A function call previously made by the model (for replaying history).
Sourcepub fn function_call_output(
call_id: impl Into<String>,
output: impl Into<String>,
) -> Self
pub fn function_call_output( call_id: impl Into<String>, output: impl Into<String>, ) -> Self
The result of executing a function call, sent back to the model.
Sourcepub fn item_reference(id: impl Into<String>) -> Self
pub fn item_reference(id: impl Into<String>) -> Self
A reference to a previously created item, by id.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for InputItem
impl<'de> Deserialize<'de> for InputItem
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for InputItem
impl RefUnwindSafe for InputItem
impl Send for InputItem
impl Sync for InputItem
impl Unpin for InputItem
impl UnsafeUnpin for InputItem
impl UnwindSafe for InputItem
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