Skip to main content

ResponsesClientEvent

Struct ResponsesClientEvent 

Source
pub struct ResponsesClientEvent {
Show 30 fields pub type_: String, pub background: Option<bool>, pub context_management: Option<Vec<ContextManagement>>, pub conversation: Option<Conversation>, pub include: Option<Vec<ResponseIncludable>>, pub input: Option<String>, pub instructions: Option<String>, pub max_output_tokens: Option<i64>, pub max_tool_calls: Option<i64>, pub metadata: Option<Value>, pub model: Option<Value>, pub parallel_tool_calls: Option<bool>, pub previous_response_id: Option<String>, pub prompt: Option<ResponsePrompt>, pub prompt_cache_key: Option<String>, pub prompt_cache_retention: Option<ResponsesClientEventPromptCacheRetention>, pub reasoning: Option<Value>, pub safety_identifier: Option<String>, pub service_tier: Option<ResponsesClientEventServiceTier>, pub store: Option<bool>, pub stream: Option<bool>, pub stream_options: Option<StreamOptions>, pub temperature: Option<f64>, pub text: Option<ResponseTextConfig>, pub tool_choice: Option<ToolChoice>, pub tools: Option<Vec<Tool>>, pub top_logprobs: Option<i64>, pub top_p: Option<f64>, pub truncation: Option<ResponsesClientEventTruncation>, pub user: Option<String>,
}

Fields§

§type_: String

The type of the client event. Always response.create.

§background: Option<bool>

Whether to run the model response in the background.

§context_management: Option<Vec<ContextManagement>>

Context management configuration for this request.

§conversation: Option<Conversation>

The conversation that this response belongs to.

§include: Option<Vec<ResponseIncludable>>

Specify additional output data to include in the model response.

§input: Option<String>

Text, image, or file inputs to the model, used to generate a response.

§instructions: Option<String>

A system (or developer) message inserted into the model’s context.

§max_output_tokens: Option<i64>

An upper bound for the number of tokens that can be generated for a response,

§max_tool_calls: Option<i64>

The maximum number of total calls to built-in tools that can be processed in a

§metadata: Option<Value>

Set of 16 key-value pairs that can be attached to an object.

§model: Option<Value>

Model ID used to generate the response, like gpt-4o or o3.

§parallel_tool_calls: Option<bool>

Whether to allow the model to run tool calls in parallel.

§previous_response_id: Option<String>

The unique ID of the previous response to the model.

§prompt: Option<ResponsePrompt>

Reference to a prompt template and its variables.

§prompt_cache_key: Option<String>

Used by OpenAI to cache responses for similar requests to optimize your cache

§prompt_cache_retention: Option<ResponsesClientEventPromptCacheRetention>

The retention policy for the prompt cache.

§reasoning: Option<Value>

gpt-5 and o-series models only

§safety_identifier: Option<String>

A stable identifier used to help detect users of your application that may be

§service_tier: Option<ResponsesClientEventServiceTier>

Specifies the processing type used for serving the request.

§store: Option<bool>

Whether to store the generated model response for later retrieval via API.

§stream: Option<bool>

If set to true, the model response data will be streamed to the client as it is

§stream_options: Option<StreamOptions>

Options for streaming responses. Only set this when you set stream: true.

§temperature: Option<f64>

What sampling temperature to use, between 0 and 2.

§text: Option<ResponseTextConfig>

Configuration options for a text response from the model.

§tool_choice: Option<ToolChoice>

How the model should select which tool (or tools) to use when generating a

§tools: Option<Vec<Tool>>

An array of tools the model may call while generating a response.

§top_logprobs: Option<i64>

An integer between 0 and 20 specifying the number of most likely tokens to

§top_p: Option<f64>

An alternative to sampling with temperature, called nucleus sampling, where the

§truncation: Option<ResponsesClientEventTruncation>

The truncation strategy to use for the model response.

§user: Option<String>

This field is being replaced by safety_identifier and prompt_cache_key.

Trait Implementations§

Source§

impl Clone for ResponsesClientEvent

Source§

fn clone(&self) -> ResponsesClientEvent

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 ResponsesClientEvent

Source§

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

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

impl<'de> Deserialize<'de> for ResponsesClientEvent

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for ResponsesClientEvent

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.