pub struct ResponseCreateRequest {Show 22 fields
pub model: String,
pub input: Option<ResponseInput>,
pub instructions: Option<String>,
pub tools: Option<Vec<ResponseTool>>,
pub tool_choice: Option<ResponseToolChoice>,
pub parallel_tool_calls: Option<bool>,
pub previous_response_id: Option<String>,
pub temperature: Option<f64>,
pub top_p: Option<f64>,
pub max_output_tokens: Option<i64>,
pub truncation: Option<String>,
pub reasoning: Option<Reasoning>,
pub store: Option<bool>,
pub metadata: Option<HashMap<String, String>>,
pub include: Option<Vec<String>>,
pub stream: Option<bool>,
pub service_tier: Option<String>,
pub user: Option<String>,
pub text: Option<ResponseTextConfig>,
pub prompt_cache_key: Option<String>,
pub prompt_cache_retention: Option<String>,
pub background: Option<bool>,
}Expand description
Request body for POST /responses.
Fields§
§model: StringModel to use.
input: Option<ResponseInput>Input text or messages.
instructions: Option<String>System instructions.
tools: Option<Vec<ResponseTool>>Tools available to the model.
tool_choice: Option<ResponseToolChoice>How the model selects tools.
parallel_tool_calls: Option<bool>Whether to enable parallel tool calls.
previous_response_id: Option<String>Previous response ID for multi-turn.
temperature: Option<f64>Temperature (0-2).
top_p: Option<f64>Nucleus sampling parameter.
max_output_tokens: Option<i64>Max output tokens.
truncation: Option<String>Truncation strategy: “auto” or “disabled”.
reasoning: Option<Reasoning>Reasoning configuration for o-series models.
store: Option<bool>Store for evals/distillation.
metadata: Option<HashMap<String, String>>Metadata key-value pairs.
include: Option<Vec<String>>Additional data to include in response.
stream: Option<bool>Whether to stream.
service_tier: Option<String>Service tier.
user: Option<String>End user identifier.
text: Option<ResponseTextConfig>Text output configuration.
prompt_cache_key: Option<String>Prompt cache key — caches system prompt prefix server-side for faster repeat calls.
prompt_cache_retention: Option<String>Prompt cache retention: “in-memory” or “24h” for extended caching.
background: Option<bool>Whether to run in background mode.
Implementations§
Source§impl ResponseCreateRequest
impl ResponseCreateRequest
Sourcepub fn input(self, input: impl Into<ResponseInput>) -> Self
pub fn input(self, input: impl Into<ResponseInput>) -> Self
Set the input text or messages.
Sourcepub fn instructions(self, instructions: impl Into<String>) -> Self
pub fn instructions(self, instructions: impl Into<String>) -> Self
Set system instructions.
Sourcepub fn tools(self, tools: Vec<ResponseTool>) -> Self
pub fn tools(self, tools: Vec<ResponseTool>) -> Self
Set the tools.
Sourcepub fn tool_choice(self, choice: ResponseToolChoice) -> Self
pub fn tool_choice(self, choice: ResponseToolChoice) -> Self
Set how the model selects tools.
Sourcepub fn previous_response_id(self, id: impl Into<String>) -> Self
pub fn previous_response_id(self, id: impl Into<String>) -> Self
Set previous response ID for multi-turn.
Sourcepub fn temperature(self, temperature: f64) -> Self
pub fn temperature(self, temperature: f64) -> Self
Set the temperature (0-2).
Sourcepub fn max_output_tokens(self, max: i64) -> Self
pub fn max_output_tokens(self, max: i64) -> Self
Set max output tokens.
Sourcepub fn truncation(self, truncation: impl Into<String>) -> Self
pub fn truncation(self, truncation: impl Into<String>) -> Self
Set truncation strategy.
Sourcepub fn text(self, text: ResponseTextConfig) -> Self
pub fn text(self, text: ResponseTextConfig) -> Self
Set text output configuration (format + verbosity).
Sourcepub fn parallel_tool_calls(self, parallel: bool) -> Self
pub fn parallel_tool_calls(self, parallel: bool) -> Self
Enable or disable parallel tool calls.
Sourcepub fn include(self, include: Vec<String>) -> Self
pub fn include(self, include: Vec<String>) -> Self
Set include fields for additional response data.
Sourcepub fn service_tier(self, tier: impl Into<String>) -> Self
pub fn service_tier(self, tier: impl Into<String>) -> Self
Set service tier (“auto”, “default”, “flex”, “scale”, “priority”).
Sourcepub fn prompt_cache_key(self, key: impl Into<String>) -> Self
pub fn prompt_cache_key(self, key: impl Into<String>) -> Self
Set prompt cache key for server-side system prompt caching.
Sourcepub fn prompt_cache_retention(self, retention: impl Into<String>) -> Self
pub fn prompt_cache_retention(self, retention: impl Into<String>) -> Self
Set prompt cache retention: “in-memory” or “24h”.
Sourcepub fn background(self, background: bool) -> Self
pub fn background(self, background: bool) -> Self
Run response in background mode.
Trait Implementations§
Source§impl Clone for ResponseCreateRequest
impl Clone for ResponseCreateRequest
Source§fn clone(&self) -> ResponseCreateRequest
fn clone(&self) -> ResponseCreateRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more