pub struct DefaultModelResolver;Expand description
Default model resolver that uses prefix-based provider inference for shorthand names and explicit provider fields for structured refs.
§Construction Behavior
The DefaultModelResolver currently returns a ResolverError::ConstructionFailed
for all resolved providers because actual model construction requires API keys
and network access. The important logic here is the resolution — mapping a
ModelRef to the correct provider. The platform layer is responsible for
injecting a custom ModelResolver that can actually construct models with
credentials.
§Example
ⓘ
use adk_managed::resolver::DefaultModelResolver;
let resolver = DefaultModelResolver::new();
// In production, use a resolver that has access to credentials.Implementations§
Trait Implementations§
Source§impl Clone for DefaultModelResolver
impl Clone for DefaultModelResolver
Source§fn clone(&self) -> DefaultModelResolver
fn clone(&self) -> DefaultModelResolver
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DefaultModelResolver
impl Debug for DefaultModelResolver
Source§impl Default for DefaultModelResolver
impl Default for DefaultModelResolver
Source§fn default() -> DefaultModelResolver
fn default() -> DefaultModelResolver
Returns the “default value” for a type. Read more
Source§impl ModelResolver for DefaultModelResolver
impl ModelResolver for DefaultModelResolver
Source§fn resolve<'life0, 'life1, 'async_trait>(
&'life0 self,
model_ref: &'life1 ModelRef,
) -> Pin<Box<dyn Future<Output = ResolverResult<Arc<dyn Llm>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn resolve<'life0, 'life1, 'async_trait>(
&'life0 self,
model_ref: &'life1 ModelRef,
) -> Pin<Box<dyn Future<Output = ResolverResult<Arc<dyn Llm>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Resolve a model reference into a callable LLM instance.
Auto Trait Implementations§
impl Freeze for DefaultModelResolver
impl RefUnwindSafe for DefaultModelResolver
impl Send for DefaultModelResolver
impl Sync for DefaultModelResolver
impl Unpin for DefaultModelResolver
impl UnsafeUnpin for DefaultModelResolver
impl UnwindSafe for DefaultModelResolver
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