#[non_exhaustive]pub struct OpenAiChatExt {
pub cache_key: Option<String>,
pub service_tier: Option<ServiceTier>,
}Expand description
OpenAI Chat Completions API knobs.
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.cache_key: Option<String>prompt_cache_key — routing key into OpenAI’s auto-cache
bucket. Related requests sharing this key land in the same
cache shard for higher hit rate. OpenAI-specific (Anthropic
per-block cache_control, Gemini cachedContent, and
Bedrock cachePoint are different mechanisms with different
shapes). Mirrored on OpenAiResponsesExt::cache_key.
service_tier: Option<ServiceTier>service_tier — cost / latency routing for the request.
Flex halves cost in exchange for higher latency, Priority
reserves dedicated capacity for SLA-bound workflows, Scale
targets sustained high-throughput tenants. OpenAI-specific
(no other vendor exposes a comparable per-request routing
knob). Mirrored on OpenAiResponsesExt::service_tier.
Implementations§
Source§impl OpenAiChatExt
impl OpenAiChatExt
Sourcepub fn with_cache_key(self, key: impl Into<String>) -> Self
pub fn with_cache_key(self, key: impl Into<String>) -> Self
Set the prompt-cache routing key.
Sourcepub const fn with_service_tier(self, tier: ServiceTier) -> Self
pub const fn with_service_tier(self, tier: ServiceTier) -> Self
Set the service-tier routing.
Trait Implementations§
Source§impl Clone for OpenAiChatExt
impl Clone for OpenAiChatExt
Source§fn clone(&self) -> OpenAiChatExt
fn clone(&self) -> OpenAiChatExt
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 OpenAiChatExt
impl Debug for OpenAiChatExt
Source§impl Default for OpenAiChatExt
impl Default for OpenAiChatExt
Source§fn default() -> OpenAiChatExt
fn default() -> OpenAiChatExt
Source§impl<'de> Deserialize<'de> for OpenAiChatExt
impl<'de> Deserialize<'de> for OpenAiChatExt
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>,
Source§impl PartialEq for OpenAiChatExt
impl PartialEq for OpenAiChatExt
Source§fn eq(&self, other: &OpenAiChatExt) -> bool
fn eq(&self, other: &OpenAiChatExt) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for OpenAiChatExt
impl Serialize for OpenAiChatExt
impl Eq for OpenAiChatExt
impl StructuralPartialEq for OpenAiChatExt
Auto Trait Implementations§
impl Freeze for OpenAiChatExt
impl RefUnwindSafe for OpenAiChatExt
impl Send for OpenAiChatExt
impl Sync for OpenAiChatExt
impl Unpin for OpenAiChatExt
impl UnsafeUnpin for OpenAiChatExt
impl UnwindSafe for OpenAiChatExt
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.