pub struct InputItem {
pub typ: Option<InputItemType>,
pub role: Option<InputRole>,
pub content: Option<InputContent>,
pub call_id: Option<String>,
pub name: Option<String>,
pub arguments: Option<String>,
pub output: Option<String>,
}Expand description
A single input item of a Responses request.
Fields§
§typ: Option<InputItemType>The type of the input item. For message items, this field can be omitted if role is present.
role: Option<InputRole>For message items. The role of the message author. developer is treated as system.
content: Option<InputContent>For message items, the message content, either a plain string or a list of content parts.
For reasoning items, a list of reasoning_text content parts.
call_id: Option<String>For function_call / function_call_output items. The ID pairing a function call with its output.
name: Option<String>For function_call items. The name of the function to call.
arguments: Option<String>For function_call items. The arguments to call the function with, in JSON format.
output: Option<String>For function_call_output items. The output of the function call.
Implementations§
Source§impl InputItem
impl InputItem
Sourcepub fn user(content: impl Into<String>) -> Self
pub fn user(content: impl Into<String>) -> Self
Build a user message input item from plain text.
Sourcepub fn assistant(content: impl Into<String>) -> Self
pub fn assistant(content: impl Into<String>) -> Self
Build an assistant message input item from plain text.