pub struct OpenAIResponsesConfig {
pub api_key: String,
pub model: String,
pub organization_id: Option<String>,
pub project_id: Option<String>,
pub base_url: Option<String>,
pub reasoning_effort: Option<ReasoningEffort>,
pub reasoning_summary: Option<ReasoningSummary>,
pub transport: Option<ResponsesTransport>,
pub service_tier: Option<ServiceTier>,
pub prompt_cache_retention: Option<PromptCacheRetention>,
pub open_responses_mode: Option<bool>,
}models and openai only.Expand description
Fields§
§api_key: StringOpenAI API key.
model: StringModel name (e.g., “o3”, “o4-mini”, “gpt-4.1”).
organization_id: Option<String>Optional organization ID.
project_id: Option<String>Optional project ID.
base_url: Option<String>Optional custom base URL.
reasoning_effort: Option<ReasoningEffort>Reasoning effort for o-series models.
reasoning_summary: Option<ReasoningSummary>Reasoning summary mode for o-series models.
transport: Option<ResponsesTransport>Transport mode (HTTP or WebSocket).
service_tier: Option<ServiceTier>Default service tier for processing priority.
prompt_cache_retention: Option<PromptCacheRetention>Default prompt cache retention policy.
open_responses_mode: Option<bool>Enable Open Responses mode for third-party compatibility.
When enabled, relaxes strict OpenAI field validation to support Open Responses-compatible endpoints (LM Studio, Ollama, vLLM).
Implementations§
Source§impl OpenAIResponsesConfig
impl OpenAIResponsesConfig
Sourcepub fn new(
api_key: impl Into<String>,
model: impl Into<String>,
) -> OpenAIResponsesConfig
pub fn new( api_key: impl Into<String>, model: impl Into<String>, ) -> OpenAIResponsesConfig
Create a new Responses API config with the given API key and model.
Sourcepub fn with_organization(
self,
org_id: impl Into<String>,
) -> OpenAIResponsesConfig
pub fn with_organization( self, org_id: impl Into<String>, ) -> OpenAIResponsesConfig
Set the organization ID.
Sourcepub fn with_project(
self,
project_id: impl Into<String>,
) -> OpenAIResponsesConfig
pub fn with_project( self, project_id: impl Into<String>, ) -> OpenAIResponsesConfig
Set the project ID.
Sourcepub fn with_base_url(self, base_url: impl Into<String>) -> OpenAIResponsesConfig
pub fn with_base_url(self, base_url: impl Into<String>) -> OpenAIResponsesConfig
Set the base URL.
Sourcepub fn with_reasoning_effort(
self,
effort: ReasoningEffort,
) -> OpenAIResponsesConfig
pub fn with_reasoning_effort( self, effort: ReasoningEffort, ) -> OpenAIResponsesConfig
Set the reasoning effort for o-series models.
Sourcepub fn with_reasoning_summary(
self,
summary: ReasoningSummary,
) -> OpenAIResponsesConfig
pub fn with_reasoning_summary( self, summary: ReasoningSummary, ) -> OpenAIResponsesConfig
Set the reasoning summary mode for o-series models.
Sourcepub fn with_transport(
self,
transport: ResponsesTransport,
) -> OpenAIResponsesConfig
pub fn with_transport( self, transport: ResponsesTransport, ) -> OpenAIResponsesConfig
Set the transport mode (HTTP or WebSocket).
Defaults to HTTP when not set. WebSocket requires the openai-ws feature.
Sourcepub fn with_service_tier(self, tier: ServiceTier) -> OpenAIResponsesConfig
pub fn with_service_tier(self, tier: ServiceTier) -> OpenAIResponsesConfig
Set the default service tier for processing priority.
Priority tier provides lower latency and more consistent token generation.
Sourcepub fn with_prompt_cache_retention(
self,
retention: PromptCacheRetention,
) -> OpenAIResponsesConfig
pub fn with_prompt_cache_retention( self, retention: PromptCacheRetention, ) -> OpenAIResponsesConfig
Set the default prompt cache retention policy.
Controls how long prompt prefixes are cached for cost optimization.
Sourcepub fn with_open_responses_mode(self, enabled: bool) -> OpenAIResponsesConfig
pub fn with_open_responses_mode(self, enabled: bool) -> OpenAIResponsesConfig
Enable or disable Open Responses mode.
When enabled, relaxes strict OpenAI field validation for compatibility with third-party Open Responses-compatible endpoints.
Trait Implementations§
Source§impl Clone for OpenAIResponsesConfig
impl Clone for OpenAIResponsesConfig
Source§fn clone(&self) -> OpenAIResponsesConfig
fn clone(&self) -> OpenAIResponsesConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more