pub struct ProviderHandle { /* private fields */ }Expand description
Owning handle to provider components. Session state + config store this so we can add Clone / Serialize / Deserialize impls without running into orphan-rule conflicts.
Implementations§
Source§impl ProviderHandle
impl ProviderHandle
pub fn new(components: ProviderComponents) -> Self
pub fn components(&self) -> &ProviderComponents
pub fn components_mut(&mut self) -> &mut ProviderComponents
pub fn kind(&self) -> &'static str
pub fn default_model(&self) -> &str
pub fn supported_variants(&self, model: &str) -> &'static [&'static str]
pub fn default_model_variant(&self, model: &str) -> Option<&'static str>
pub fn validate_variant(&self, model: &str, variant: &str) -> Result<(), String>
pub fn request_variant_config( &self, model: &str, variant: &str, ) -> Option<VariantRequestConfig>
pub fn default_agent_model(&self, tier: &str) -> Option<AgentModelSelection>
pub fn resolve_model(&self, model: &str) -> String
pub fn context_lookup_model(&self, model: &str) -> String
pub fn input_usage_excludes_cached_tokens(&self) -> bool
pub fn options(&self) -> ProviderOptions
pub fn set_options(&mut self, options: ProviderOptions)
pub fn requires_streaming(&self) -> bool
pub async fn complete( &mut self, request: LlmRequest, ) -> Result<LlmResponse, LlmTransportError>
pub fn to_spec(&self) -> ProviderSpec
Sourcepub fn validate_model_name(&self, model: &str) -> Result<(), String>
pub fn validate_model_name(&self, model: &str) -> Result<(), String>
Validate model syntax only.
Sourcepub fn resolve_model_spec(
&self,
model: &str,
catalog: &ModelCatalog,
) -> Result<ResolvedModelSpec, String>
pub fn resolve_model_spec( &self, model: &str, catalog: &ModelCatalog, ) -> Result<ResolvedModelSpec, String>
Resolve a model against an explicit catalog supplied by the host.
Trait Implementations§
Source§impl Clone for ProviderHandle
impl Clone for ProviderHandle
Source§impl Debug for ProviderHandle
impl Debug for ProviderHandle
Source§impl Default for ProviderHandle
impl Default for ProviderHandle
Source§impl<'de> Deserialize<'de> for ProviderHandle
impl<'de> Deserialize<'de> for ProviderHandle
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ProviderHandle
impl PartialEq for ProviderHandle
Source§impl Serialize for ProviderHandle
impl Serialize for ProviderHandle
impl Eq for ProviderHandle
Auto Trait Implementations§
impl Freeze for ProviderHandle
impl !RefUnwindSafe for ProviderHandle
impl Send for ProviderHandle
impl Sync for ProviderHandle
impl Unpin for ProviderHandle
impl UnsafeUnpin for ProviderHandle
impl !UnwindSafe for ProviderHandle
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
Mutably borrows from an owned value. Read more