pub struct GitHubCopilotClient { /* private fields */ }Expand description
GitHub Copilot API client
Implementations§
Source§impl GitHubCopilotClient
impl GitHubCopilotClient
Sourcepub async fn new() -> Result<Self, LlmError>
pub async fn new() -> Result<Self, LlmError>
Create a new GitHub Copilot client with OAuth flow
Sourcepub fn with_api_key(
api_key: impl Into<String>,
access_token: impl Into<String>,
) -> Self
pub fn with_api_key( api_key: impl Into<String>, access_token: impl Into<String>, ) -> Self
Create with explicit API key (for testing or pre-authenticated scenarios)
pub fn with_editor_version(self, version: impl Into<String>) -> Self
pub fn with_integration_id(self, id: impl Into<String>) -> Self
pub fn get_models() -> Vec<String>
Trait Implementations§
Source§impl Clone for GitHubCopilotClient
impl Clone for GitHubCopilotClient
Source§fn clone(&self) -> GitHubCopilotClient
fn clone(&self) -> GitHubCopilotClient
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 moreSource§impl Debug for GitHubCopilotClient
impl Debug for GitHubCopilotClient
Source§impl Provider for GitHubCopilotClient
impl Provider for GitHubCopilotClient
Source§fn chat_completion<'life0, 'async_trait>(
&'life0 self,
request: ChatCompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatCompletionResponse, LlmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn chat_completion<'life0, 'async_trait>(
&'life0 self,
request: ChatCompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatCompletionResponse, LlmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Generate a chat completion
Source§fn chat_completion_stream(
&self,
request: ChatCompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatCompletionStream, LlmError>> + Send + '_>>
fn chat_completion_stream( &self, request: ChatCompletionRequest, ) -> Pin<Box<dyn Future<Output = Result<ChatCompletionStream, LlmError>> + Send + '_>>
Stream a chat completion
Source§fn embeddings<'life0, 'async_trait>(
&'life0 self,
request: EmbeddingRequest,
) -> Pin<Box<dyn Future<Output = Result<EmbeddingResponse, LlmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn embeddings<'life0, 'async_trait>(
&'life0 self,
request: EmbeddingRequest,
) -> Pin<Box<dyn Future<Output = Result<EmbeddingResponse, LlmError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Generate embeddings for text
Source§fn provider_name(&self) -> &'static str
fn provider_name(&self) -> &'static str
Get the provider name
Source§fn supported_models(&self) -> Vec<String>
fn supported_models(&self) -> Vec<String>
Get the list of models supported by this provider
Auto Trait Implementations§
impl Freeze for GitHubCopilotClient
impl !RefUnwindSafe for GitHubCopilotClient
impl Send for GitHubCopilotClient
impl Sync for GitHubCopilotClient
impl Unpin for GitHubCopilotClient
impl UnsafeUnpin for GitHubCopilotClient
impl !UnwindSafe for GitHubCopilotClient
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