pub struct Provider {
pub id: String,
pub name: String,
pub provider_type: ProviderType,
pub capabilities: Vec<Capability>,
pub cost_level: CostLevel,
pub latency: Latency,
pub keywords: Vec<String>,
}Expand description
A provider that can fulfill capabilities
Fields§
§id: StringUnique identifier for this provider
name: StringHuman-readable name
provider_type: ProviderTypeType of provider (LLM or Agent)
capabilities: Vec<Capability>Capabilities this provider can fulfill
cost_level: CostLevelCost level
latency: LatencyExpected latency
keywords: Vec<String>Keywords that trigger this provider
Implementations§
Source§impl Provider
impl Provider
Sourcepub fn new(
id: impl Into<String>,
name: impl Into<String>,
provider_type: ProviderType,
capabilities: Vec<Capability>,
) -> Provider
pub fn new( id: impl Into<String>, name: impl Into<String>, provider_type: ProviderType, capabilities: Vec<Capability>, ) -> Provider
Create a new provider
Sourcepub fn with_latency(self, latency: Latency) -> Provider
pub fn with_latency(self, latency: Latency) -> Provider
Set latency
Sourcepub fn with_keywords(self, keywords: Vec<String>) -> Provider
pub fn with_keywords(self, keywords: Vec<String>) -> Provider
Set keywords
Sourcepub fn has_capability(&self, capability: &Capability) -> bool
pub fn has_capability(&self, capability: &Capability) -> bool
Check if this provider has a specific capability
Sourcepub fn has_all_capabilities(&self, capabilities: &[Capability]) -> bool
pub fn has_all_capabilities(&self, capabilities: &[Capability]) -> bool
Check if this provider has all the given capabilities
Sourcepub fn matches_keywords(&self, text: &str) -> bool
pub fn matches_keywords(&self, text: &str) -> bool
Check if any of the provider’s keywords match the given text
Sourcepub fn capability_names(&self) -> Vec<String>
pub fn capability_names(&self) -> Vec<String>
Get capabilities as strings
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Provider
impl<'de> Deserialize<'de> for Provider
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Provider, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Provider, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for Provider
impl Serialize for Provider
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for Provider
impl RefUnwindSafe for Provider
impl Send for Provider
impl Sync for Provider
impl Unpin for Provider
impl UnsafeUnpin for Provider
impl UnwindSafe for Provider
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more