#[non_exhaustive]pub struct CreateResponseRequest {Show 31 fields
pub model: String,
pub input: ResponseInput,
pub instructions: Option<String>,
pub personality: Option<String>,
pub previous_response_id: Option<String>,
pub conversation: Option<ResponseConversation>,
pub context_management: Option<Vec<ResponseContextManagement>>,
pub moderation: Option<ResponseModeration>,
pub tools: Vec<Value>,
pub tool_choice: Option<ResponseToolChoice>,
pub prompt: Option<ResponsePrompt>,
pub max_output_tokens: Option<u32>,
pub store: Option<bool>,
pub background: Option<bool>,
pub max_tool_calls: Option<u32>,
pub metadata: BTreeMap<String, String>,
pub parallel_tool_calls: Option<bool>,
pub temperature: Option<f64>,
pub top_p: Option<f64>,
pub top_logprobs: Option<u8>,
pub reasoning: Option<ResponseReasoning>,
pub truncation: Option<ResponseTruncation>,
pub prompt_cache_key: Option<String>,
pub prompt_cache_retention: Option<ResponsePromptCacheRetention>,
pub safety_identifier: Option<String>,
pub service_tier: Option<ResponseServiceTier>,
pub include: Option<Vec<ResponseInclude>>,
pub text: Option<ResponseTextConfig>,
pub stream_options: Option<StreamOptions>,
pub stream: Option<bool>,
pub extra: BTreeMap<String, Value>,
}Expand description
EN: Request body for POST /v1/responses.
中文:POST /v1/responses 的请求体。
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.model: StringEN: Model id used to generate the response. 中文:用于生成响应的模型 ID。
input: ResponseInputEN: Input text or message list. 中文:输入文本或消息列表。
instructions: Option<String>EN: Optional system or developer instructions for this response. 中文:此响应可选的系统或开发者指令。
personality: Option<String>EN: Optional model-owned style preset to apply to this response. 中文:应用于此响应的可选模型自有风格预设。
previous_response_id: Option<String>EN: Optional previous response id for multi-turn conversation state. 中文:用于多轮会话状态的可选上一条响应 ID。
conversation: Option<ResponseConversation>EN: Optional conversation this response should belong to. 中文:此响应应归属的可选 conversation。
context_management: Option<Vec<ResponseContextManagement>>EN: Optional context management entries for this response request. 中文:此响应请求的可选上下文管理条目。
moderation: Option<ResponseModeration>EN: Optional moderation configuration for this response request. 中文:此响应请求的可选 moderation 配置。
tools: Vec<Value>EN: Optional tools the model may call while generating the response. 中文:模型生成响应时可以调用的可选工具列表。
tool_choice: Option<ResponseToolChoice>EN: Optional mode controlling whether the model may call tools. 中文:控制模型是否可以调用工具的可选模式。
prompt: Option<ResponsePrompt>EN: Optional reusable prompt template reference and variables. 中文:可选的可复用 prompt 模板引用及变量。
max_output_tokens: Option<u32>EN: Optional upper bound for generated output tokens. 中文:生成输出 token 数量的可选上限。
store: Option<bool>EN: Whether to store the generated response for later retrieval. 中文:是否存储生成的响应以便稍后检索。
background: Option<bool>EN: Whether to run the model response in the background. 中文:是否在后台运行模型响应。
max_tool_calls: Option<u32>EN: Optional maximum number of built-in tool calls for the response. 中文:响应中内置工具调用总次数的可选上限。
metadata: BTreeMap<String, String>EN: Optional metadata attached to the generated response. 中文:附加到生成响应的可选元数据。
parallel_tool_calls: Option<bool>EN: Whether to allow tool calls to run in parallel. 中文:是否允许并行运行工具调用。
temperature: Option<f64>EN: Optional sampling temperature. 中文:可选的采样温度。
top_p: Option<f64>EN: Optional nucleus sampling value. 中文:可选的 nucleus sampling 值。
top_logprobs: Option<u8>EN: Optional maximum number of top token log probabilities to return. 中文:可选的每个 token 位置返回的最高概率 token log probability 数量。
reasoning: Option<ResponseReasoning>EN: Optional reasoning configuration for reasoning-capable models. 中文:支持推理模型的可选推理配置。
truncation: Option<ResponseTruncation>EN: Optional context truncation strategy for the response. 中文:响应可选的上下文截断策略。
prompt_cache_key: Option<String>EN: Optional prompt cache bucketing key for similar requests. 中文:用于相似请求提示缓存分桶的可选键。
prompt_cache_retention: Option<ResponsePromptCacheRetention>EN: Optional retention policy for prompt cache entries created by this request. 中文:此请求创建的提示缓存条目的可选保留策略。
safety_identifier: Option<String>EN: Optional stable safety identifier for abuse detection. 中文:用于滥用检测的可选稳定安全标识符。
service_tier: Option<ResponseServiceTier>EN: Optional processing tier for serving the response request. 中文:用于处理响应请求的可选服务层级。
include: Option<Vec<ResponseInclude>>EN: Optional additional output data to include in the model response. 中文:要包含在模型响应中的可选额外输出数据。
text: Option<ResponseTextConfig>EN: Optional text generation configuration. 中文:可选的文本生成配置。
stream_options: Option<StreamOptions>EN: Optional streaming configuration used when streaming a response. 中文:流式响应时使用的可选流配置。
stream: Option<bool>EN: Optional stream flag set by streaming convenience methods. 中文:由流式便捷方法设置的可选 stream 标志。
extra: BTreeMap<String, Value>EN: Forward-compatible optional fields not yet covered by handwritten types. 中文:手写类型尚未覆盖的前向兼容可选字段。
Implementations§
Source§impl CreateResponseRequest
impl CreateResponseRequest
Sourcepub fn builder() -> CreateResponseRequestBuilder
pub fn builder() -> CreateResponseRequestBuilder
EN: Starts building a create-response request. 中文:开始构建创建响应请求。
Trait Implementations§
Source§impl Clone for CreateResponseRequest
impl Clone for CreateResponseRequest
Source§fn clone(&self) -> CreateResponseRequest
fn clone(&self) -> CreateResponseRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CreateResponseRequest
impl Debug for CreateResponseRequest
Source§impl PartialEq for CreateResponseRequest
impl PartialEq for CreateResponseRequest
Source§fn eq(&self, other: &CreateResponseRequest) -> bool
fn eq(&self, other: &CreateResponseRequest) -> bool
self and other values to be equal, and is used by ==.