pub struct CopilotProvider { /* private fields */ }Expand description
Provider capable of listing and instantiating Copilot models.
Implementations§
Source§impl CopilotProvider
impl CopilotProvider
Sourcepub fn new(token: impl Into<String>) -> CopilotProvider
pub fn new(token: impl Into<String>) -> CopilotProvider
Create a new provider with the given session token.
Sourcepub fn base_url(self, url: impl Into<String>) -> CopilotProvider
pub fn base_url(self, url: impl Into<String>) -> CopilotProvider
Set the base URL for API calls.
Sourcepub fn oauth_token(self, token: impl Into<String>) -> CopilotProvider
pub fn oauth_token(self, token: impl Into<String>) -> CopilotProvider
Provide OAuth token so short-lived session tokens can be refreshed.
Trait Implementations§
Source§impl Clone for CopilotProvider
impl Clone for CopilotProvider
Source§fn clone(&self) -> CopilotProvider
fn clone(&self) -> CopilotProvider
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 CopilotProvider
impl Debug for CopilotProvider
Source§impl From<CopilotProvider> for CloudModelProvider
impl From<CopilotProvider> for CloudModelProvider
Source§fn from(provider: CopilotProvider) -> Self
fn from(provider: CopilotProvider) -> Self
Converts to this type from the input type.
Source§impl LanguageModelProvider for CopilotProvider
impl LanguageModelProvider for CopilotProvider
Source§type Error = CopilotError
type Error = CopilotError
The error type returned by this provider.
Source§fn list_models(
&self,
) -> impl Future<Output = Result<Vec<Profile>, <CopilotProvider as LanguageModelProvider>::Error>> + Send
fn list_models( &self, ) -> impl Future<Output = Result<Vec<Profile>, <CopilotProvider as LanguageModelProvider>::Error>> + Send
Lists all available models from this provider.
Source§fn get_model(
&self,
name: &str,
) -> impl Future<Output = Result<<CopilotProvider as LanguageModelProvider>::Model, <CopilotProvider as LanguageModelProvider>::Error>> + Send
fn get_model( &self, name: &str, ) -> impl Future<Output = Result<<CopilotProvider as LanguageModelProvider>::Model, <CopilotProvider as LanguageModelProvider>::Error>> + Send
Gets a specific model by name from this provider.
Auto Trait Implementations§
impl Forget for CopilotProvider
impl Freeze for CopilotProvider
impl RefUnwindSafe for CopilotProvider
impl Send for CopilotProvider
impl Sync for CopilotProvider
impl Unpin for CopilotProvider
impl UnsafeUnpin for CopilotProvider
impl UnwindSafe for CopilotProvider
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