pub enum ProviderClient {
CodineerApi(CodineerApiClient),
Xai(OpenAiCompatClient),
OpenAi(OpenAiCompatClient),
Custom(OpenAiCompatClient),
}Variants§
CodineerApi(CodineerApiClient)
Xai(OpenAiCompatClient)
OpenAi(OpenAiCompatClient)
Custom(OpenAiCompatClient)
Implementations§
Source§impl ProviderClient
impl ProviderClient
pub fn from_model(model: &str) -> Result<Self, ApiError>
pub fn from_model_with_default_auth( model: &str, default_auth: Option<AuthSource>, ) -> Result<Self, ApiError>
Sourcepub fn from_model_with_credential(
model: &str,
credential: ResolvedCredential,
) -> Result<Self, ApiError>
pub fn from_model_with_credential( model: &str, credential: ResolvedCredential, ) -> Result<Self, ApiError>
Build a provider client using a pre-resolved credential from a CredentialChain.
Sourcepub fn from_custom(client: OpenAiCompatClient) -> Self
pub fn from_custom(client: OpenAiCompatClient) -> Self
Construct a Custom provider client from a pre-configured OpenAiCompatClient.
pub const fn provider_kind(&self) -> ProviderKind
pub async fn send_message( &self, request: &MessageRequest, ) -> Result<MessageResponse, ApiError>
pub async fn stream_message( &self, request: &MessageRequest, ) -> Result<MessageStream, ApiError>
Trait Implementations§
Source§impl Clone for ProviderClient
impl Clone for ProviderClient
Source§fn clone(&self) -> ProviderClient
fn clone(&self) -> ProviderClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ProviderClient
impl !RefUnwindSafe for ProviderClient
impl Send for ProviderClient
impl Sync for ProviderClient
impl Unpin for ProviderClient
impl UnsafeUnpin for ProviderClient
impl !UnwindSafe for ProviderClient
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