pub enum InputItem {
ItemReference(ItemReference),
Item(Item),
EasyMessage(EasyInputMessage),
}response-types only.Expand description
Input item that can be used in the context for generating a response.
This represents the OpenAPI InputItem schema which is an anyOf:
EasyInputMessage- Simple, user-friendly message input (can use string content)Item- Structured items with proper type discrimination (including InputMessage, OutputMessage, tool calls)ItemReferenceParam- Reference to an existing item by ID (type can be null)
Uses untagged deserialization because these types overlap in structure. Order matters: more specific structures are tried first.
§OpenAPI Specification
Corresponds to the InputItem schema: anyOf[EasyInputMessage, Item, ItemReferenceParam]
Variants§
ItemReference(ItemReference)
A reference to an existing item by ID.
Has a required id field and optional type (can be “item_reference” or null).
Must be tried first as it’s the most minimal structure.
Item(Item)
All structured items with proper type discrimination.
Includes InputMessage, OutputMessage, and all tool calls/outputs.
Uses the discriminated Item enum for efficient, type-safe deserialization.
EasyMessage(EasyInputMessage)
A simple, user-friendly message input (EasyInputMessage). Supports string content and can include assistant role for previous responses. Must be tried last as it’s the most flexible structure.
A message input to the model with a role indicating instruction following
hierarchy. Instructions given with the developer or system role take
precedence over instructions given with the user role. Messages with the
assistant role are presumed to have been generated by the model in previous
interactions.
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>,
Source§impl From<EasyInputMessage> for InputItem
impl From<EasyInputMessage> for InputItem
Source§fn from(msg: EasyInputMessage) -> Self
fn from(msg: EasyInputMessage) -> Self
Source§impl From<InputItem> for InputParam
impl From<InputItem> for InputParam
Source§impl From<InputMessage> for InputItem
impl From<InputMessage> for InputItem
Source§fn from(msg: InputMessage) -> Self
fn from(msg: InputMessage) -> Self
Source§impl From<ItemReference> for InputItem
impl From<ItemReference> for InputItem
Source§fn from(item: ItemReference) -> Self
fn from(item: ItemReference) -> Self
impl StructuralPartialEq for InputItem
Auto Trait Implementations§
impl Freeze for InputItem
impl RefUnwindSafe for InputItem
impl Send for InputItem
impl Sync for InputItem
impl Unpin for InputItem
impl UnwindSafe for InputItem
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)