Skip to main content

InputItem

Enum InputItem 

Source
pub enum InputItem {
    Message {
        role: Role,
        content: MessageContent,
        id: Option<String>,
        status: Option<String>,
    },
    FunctionCall {
        call_id: String,
        name: Option<String>,
        arguments: Option<String>,
        id: Option<String>,
    },
    FunctionCallOutput {
        call_id: String,
        output: FunctionCallOutputContent,
    },
    Reasoning {
        id: Option<String>,
        content: Option<Vec<ReasoningTextPart>>,
        summary: Option<Vec<SummaryTextPart>>,
    },
    WebSearchCall {
        id: Option<String>,
        action: Option<Value>,
    },
    CustomToolCall {
        call_id: String,
        name: String,
        input: String,
        id: Option<String>,
    },
    CustomToolCallOutput {
        call_id: String,
        output: FunctionCallOutputContent,
    },
    Other(Value),
}
Expand description

An item of the input list.

Item types not listed here can be sent through Self::Other as raw JSON.

Variants§

§

Message

A message with a role and content.

Fields

§role: Role

The role of the message author: user, assistant, system, or developer.

§content: MessageContent

The message content: plain text or an array of content parts.

§id: Option<String>

The unique ID of the message (present when passing back an output message from a previous response).

§status: Option<String>

The status of the message (present when passing back an output message from a previous response).

§

FunctionCall

A call to a user-defined function, e.g. returned by a previous response. Must be paired with a matching InputItem::FunctionCallOutput.

Fields

§call_id: String

The ID that pairs this call with its output.

§name: Option<String>

The name of the function to call.

§arguments: Option<String>

The arguments of the call, as a JSON string.

§id: Option<String>

The unique ID of the function call item.

§

FunctionCallOutput

The output of a function call.

Fields

§call_id: String

The ID that pairs this output with the corresponding InputItem::FunctionCall.

§output: FunctionCallOutputContent

The result of the function call: plain text or an array of content parts.

§

Reasoning

A reasoning item from a previous response.

Fields

§id: Option<String>

The unique ID of the reasoning item.

§content: Option<Vec<ReasoningTextPart>>

Plaintext reasoning content parts.

§summary: Option<Vec<SummaryTextPart>>

Reasoning summaries.

§

WebSearchCall

A web search call from a previous response, passed back as-is so the server can restore the search results.

Fields

§id: Option<String>

The unique ID of the web search call.

§action: Option<Value>

The search action performed by the server.

§

CustomToolCall

A call to a custom tool (e.g. the apply_patch tool used by Codex-style agents).

Fields

§call_id: String

The ID that pairs this call with its output.

§name: String

The name of the custom tool.

§input: String

The input of the tool call.

§id: Option<String>

The unique ID of the custom tool call item.

§

CustomToolCallOutput

The output of a custom tool call.

Fields

§call_id: String

The ID that pairs this output with the corresponding InputItem::CustomToolCall.

§output: FunctionCallOutputContent

The result of the tool call: plain text or an array of content parts.

§

Other(Value)

An input item of a type not covered by the variants above, sent through as raw JSON.

Trait Implementations§

Source§

impl Clone for InputItem

Source§

fn clone(&self) -> InputItem

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for InputItem

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Serialize for InputItem

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more