pub struct ResponsesRequest {
pub model: String,
pub input: Option<ResponsesInput>,
pub stream: Option<bool>,
pub max_output_tokens: Option<u32>,
pub temperature: Option<f64>,
pub top_p: Option<f64>,
pub reasoning: Option<ResponsesReasoning>,
pub tools: Vec<ResponsesTool>,
pub tool_choice: Option<Value>,
pub plugins: Vec<Plugin>,
}Expand description
Request body for the Responses API.
Fields§
§model: StringModel id.
input: Option<ResponsesInput>Input — either a single string or structured items.
stream: Option<bool>Stream-mode flag. The SDK forces Some(true) for streaming calls
and Some(false) for blocking ones.
max_output_tokens: Option<u32>Max output tokens.
temperature: Option<f64>Sampling temperature.
top_p: Option<f64>Nucleus sampling probability.
reasoning: Option<ResponsesReasoning>Reasoning configuration.
tools: Vec<ResponsesTool>Tools available to the model.
tool_choice: Option<Value>"auto", "none", or {"type":"function","function":{"name":...}}.
plugins: Vec<Plugin>Plugin configuration.
Implementations§
Source§impl ResponsesRequest
impl ResponsesRequest
Sourcepub fn input(self, input: impl Into<ResponsesInput>) -> Self
pub fn input(self, input: impl Into<ResponsesInput>) -> Self
Set the input (string or structured items).
Sourcepub fn max_output_tokens(self, n: u32) -> Self
pub fn max_output_tokens(self, n: u32) -> Self
Cap the output length in tokens.
Sourcepub fn temperature(self, t: f64) -> Self
pub fn temperature(self, t: f64) -> Self
Set sampling temperature.
Sourcepub fn reasoning_effort(self, effort: impl Into<String>) -> Self
pub fn reasoning_effort(self, effort: impl Into<String>) -> Self
Set reasoning effort (minimal, low, medium, high).
Sourcepub fn tools(self, tools: impl IntoIterator<Item = ResponsesTool>) -> Self
pub fn tools(self, tools: impl IntoIterator<Item = ResponsesTool>) -> Self
Replace the tool list.
Sourcepub fn tool_choice(self, choice: Value) -> Self
pub fn tool_choice(self, choice: Value) -> Self
Set tool-selection strategy.
Sourcepub fn plugins(self, plugins: impl IntoIterator<Item = Plugin>) -> Self
pub fn plugins(self, plugins: impl IntoIterator<Item = Plugin>) -> Self
Append plugins (does not overwrite existing ones).
Sourcepub fn web_search(self, max_results: u32) -> Self
pub fn web_search(self, max_results: u32) -> Self
Convenience: enable the web plugin with max_results.
Trait Implementations§
Source§impl Clone for ResponsesRequest
impl Clone for ResponsesRequest
Source§fn clone(&self) -> ResponsesRequest
fn clone(&self) -> ResponsesRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ResponsesRequest
impl Debug for ResponsesRequest
Source§impl Default for ResponsesRequest
impl Default for ResponsesRequest
Source§fn default() -> ResponsesRequest
fn default() -> ResponsesRequest
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ResponsesRequest
impl<'de> Deserialize<'de> for ResponsesRequest
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ResponsesRequest
impl PartialEq for ResponsesRequest
Source§impl Serialize for ResponsesRequest
impl Serialize for ResponsesRequest
impl StructuralPartialEq for ResponsesRequest
Auto Trait Implementations§
impl Freeze for ResponsesRequest
impl RefUnwindSafe for ResponsesRequest
impl Send for ResponsesRequest
impl Sync for ResponsesRequest
impl Unpin for ResponsesRequest
impl UnsafeUnpin for ResponsesRequest
impl UnwindSafe for ResponsesRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more