pub struct ResponsesRequest {Show 13 fields
pub model: String,
pub input: Value,
pub stream: Option<bool>,
pub tools: Option<Vec<Value>>,
pub tool_choice: Option<Value>,
pub response_format: Option<Value>,
pub temperature: Option<f32>,
pub top_p: Option<f32>,
pub max_output_tokens: Option<u32>,
pub user: Option<String>,
pub prompt_cache_key: Option<String>,
pub reasoning: Option<Value>,
pub extra: HashMap<String, Value>,
}Expand description
OpenRouter/Rainy Responses API request payload.
Fields§
§model: StringThe identifier of the model to use.
input: ValueInput payload accepted by the Responses API (string, object, or array).
stream: Option<bool>If true, the response will be streamed as SSE events.
tools: Option<Vec<Value>>Responses tool definitions and/or custom tools.
tool_choice: Option<Value>Tool selection strategy.
response_format: Option<Value>Structured output format.
temperature: Option<f32>Sampling temperature.
top_p: Option<f32>Top-p nucleus sampling.
max_output_tokens: Option<u32>Maximum number of output tokens.
user: Option<String>End-user identifier (legacy fallback accepted by Rainy).
prompt_cache_key: Option<String>Prompt cache key for routing/cache optimization.
reasoning: Option<Value>Reasoning configuration object (provider/model dependent).
extra: HashMap<String, Value>Forward-compatible extra parameters.
Implementations§
Source§impl ResponsesRequest
impl ResponsesRequest
Sourcepub fn new(model: impl Into<String>, input: Value) -> Self
pub fn new(model: impl Into<String>, input: Value) -> Self
Creates a new Responses request from an arbitrary input payload.
Sourcepub fn text(model: impl Into<String>, input_text: impl Into<String>) -> Self
pub fn text(model: impl Into<String>, input_text: impl Into<String>) -> Self
Convenience constructor for plain text input.
Sourcepub fn with_stream(self, stream: bool) -> Self
pub fn with_stream(self, stream: bool) -> Self
Sets streaming mode.
Sourcepub fn with_reasoning(self, reasoning: Value) -> Self
pub fn with_reasoning(self, reasoning: Value) -> Self
Sets reasoning configuration object.
Sourcepub fn with_reasoning_effort(self, effort: impl Into<String>) -> Self
pub fn with_reasoning_effort(self, effort: impl Into<String>) -> Self
Convenience helper to set reasoning effort (low, medium, high).
Sourcepub fn with_max_output_tokens(self, max_output_tokens: u32) -> Self
pub fn with_max_output_tokens(self, max_output_tokens: u32) -> Self
Sets max output tokens.
Sourcepub fn with_prompt_cache_key(self, prompt_cache_key: impl Into<String>) -> Self
pub fn with_prompt_cache_key(self, prompt_cache_key: impl Into<String>) -> Self
Sets prompt cache key.
Sourcepub fn with_tools(self, tools: Vec<Value>) -> Self
pub fn with_tools(self, tools: Vec<Value>) -> Self
Sets tool definitions array directly.
Sourcepub fn add_function_tool(
self,
name: impl Into<String>,
description: impl Into<String>,
parameters: Value,
) -> Self
pub fn add_function_tool( self, name: impl Into<String>, description: impl Into<String>, parameters: Value, ) -> Self
Adds a function tool using Responses-style shape.
Sourcepub fn with_extra(self, key: impl Into<String>, value: Value) -> Self
pub fn with_extra(self, key: impl Into<String>, value: Value) -> Self
Adds a custom extra parameter for forward compatibility.
Trait Implementations§
Source§impl Clone for ResponsesRequest
impl Clone for ResponsesRequest
Source§fn clone(&self) -> ResponsesRequest
fn clone(&self) -> ResponsesRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more