pub enum InputItem {
CompactionTrigger(CompactionTriggerItemParam),
Program(ProgramItemParam),
ProgramOutput(ProgramOutputItemParam),
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 a oneOf:
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)CompactionTriggerItemParam- An explicit compaction triggerProgramItemParam- A program replay itemProgramOutputItemParam- A program output replay item
Program and compaction-trigger items use the type discriminator directly.
References, structured items, and easy messages retain untagged alternatives
because their shapes overlap and some allow an omitted or null type.
§OpenAPI Specification
Corresponds to the InputItem schema, including the alternatives outside Item.
Variants§
CompactionTrigger(CompactionTriggerItemParam)
An explicit compaction trigger.
Program(ProgramItemParam)
A program item echoed back for replay.
ProgramOutput(ProgramOutputItemParam)
A program output echoed back for replay.
ItemReference(ItemReference)
A reference to an existing item by ID.
Has a required id field and optional type (can be “item_reference” or null).
Tried first among the untagged alternatives 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.