pub struct GitHubCopilotProvider { /* private fields */ }Expand description
GitHub Copilot provider implementation
Implementations§
Source§impl GitHubCopilotProvider
impl GitHubCopilotProvider
Sourcepub async fn new(config: GitHubCopilotConfig) -> Result<Self, ProviderError>
pub async fn new(config: GitHubCopilotConfig) -> Result<Self, ProviderError>
Create a new GitHub Copilot provider instance
Trait Implementations§
Source§impl Clone for GitHubCopilotProvider
impl Clone for GitHubCopilotProvider
Source§impl Debug for GitHubCopilotProvider
impl Debug for GitHubCopilotProvider
Source§impl LLMProvider for GitHubCopilotProvider
impl LLMProvider for GitHubCopilotProvider
Source§fn capabilities(&self) -> &'static [ProviderCapability]
fn capabilities(&self) -> &'static [ProviderCapability]
Source§fn get_supported_openai_params(&self, model: &str) -> &'static [&'static str]
fn get_supported_openai_params(&self, model: &str) -> &'static [&'static str]
Source§async fn map_openai_params(
&self,
params: HashMap<String, Value>,
_model: &str,
) -> Result<HashMap<String, Value>, ProviderError>
async fn map_openai_params( &self, params: HashMap<String, Value>, _model: &str, ) -> Result<HashMap<String, Value>, ProviderError>
Source§async fn transform_request(
&self,
request: ChatRequest,
_context: RequestContext,
) -> Result<Value, ProviderError>
async fn transform_request( &self, request: ChatRequest, _context: RequestContext, ) -> Result<Value, ProviderError>
Source§async fn transform_response(
&self,
raw_response: &[u8],
_model: &str,
_request_id: &str,
) -> Result<ChatResponse, ProviderError>
async fn transform_response( &self, raw_response: &[u8], _model: &str, _request_id: &str, ) -> Result<ChatResponse, ProviderError>
Source§fn get_error_mapper(&self) -> Box<dyn ErrorMapper<ProviderError>>
fn get_error_mapper(&self) -> Box<dyn ErrorMapper<ProviderError>>
Source§async fn chat_completion(
&self,
request: ChatRequest,
_context: RequestContext,
) -> Result<ChatResponse, ProviderError>
async fn chat_completion( &self, request: ChatRequest, _context: RequestContext, ) -> Result<ChatResponse, ProviderError>
Source§async fn chat_completion_stream(
&self,
request: ChatRequest,
_context: RequestContext,
) -> Result<Pin<Box<dyn Stream<Item = Result<ChatChunk, ProviderError>> + Send>>, ProviderError>
async fn chat_completion_stream( &self, request: ChatRequest, _context: RequestContext, ) -> Result<Pin<Box<dyn Stream<Item = Result<ChatChunk, ProviderError>> + Send>>, ProviderError>
Source§async fn embeddings(
&self,
request: EmbeddingRequest,
_context: RequestContext,
) -> Result<EmbeddingResponse, ProviderError>
async fn embeddings( &self, request: EmbeddingRequest, _context: RequestContext, ) -> Result<EmbeddingResponse, ProviderError>
Source§async fn health_check(&self) -> HealthStatus
async fn health_check(&self) -> HealthStatus
Source§async fn calculate_cost(
&self,
_model: &str,
_input_tokens: u32,
_output_tokens: u32,
) -> Result<f64, ProviderError>
async fn calculate_cost( &self, _model: &str, _input_tokens: u32, _output_tokens: u32, ) -> Result<f64, ProviderError>
Source§fn error_provider_name(&self) -> &'static str
fn error_provider_name(&self) -> &'static str
ProviderError constructors. Read moreSource§fn supports_capability(&self, capability: &ProviderCapability) -> bool
fn supports_capability(&self, capability: &ProviderCapability) -> bool
Source§fn supports_tools(&self) -> bool
fn supports_tools(&self) -> bool
Source§fn supports_streaming(&self) -> bool
fn supports_streaming(&self) -> bool
Source§fn supports_image_generation(&self) -> bool
fn supports_image_generation(&self) -> bool
Source§fn supports_embeddings(&self) -> bool
fn supports_embeddings(&self) -> bool
Source§fn supports_vision(&self) -> bool
fn supports_vision(&self) -> bool
Source§async fn image_generation(
&self,
_request: ImageGenerationRequest,
_context: RequestContext,
) -> Result<ImageGenerationResponse, ProviderError>
async fn image_generation( &self, _request: ImageGenerationRequest, _context: RequestContext, ) -> Result<ImageGenerationResponse, ProviderError>
Source§async fn image_edit(
&self,
_request: ImageEditRequest,
_context: RequestContext,
) -> Result<ImageGenerationResponse, ProviderError>
async fn image_edit( &self, _request: ImageEditRequest, _context: RequestContext, ) -> Result<ImageGenerationResponse, ProviderError>
Source§async fn audio_transcription(
&self,
_request: TranscriptionRequest,
_context: RequestContext,
) -> Result<TranscriptionResponse, ProviderError>
async fn audio_transcription( &self, _request: TranscriptionRequest, _context: RequestContext, ) -> Result<TranscriptionResponse, ProviderError>
Source§async fn audio_translation(
&self,
_request: TranslationRequest,
_context: RequestContext,
) -> Result<TranslationResponse, ProviderError>
async fn audio_translation( &self, _request: TranslationRequest, _context: RequestContext, ) -> Result<TranslationResponse, ProviderError>
Source§async fn text_to_speech(
&self,
_request: SpeechRequest,
_context: RequestContext,
) -> Result<SpeechResponse, ProviderError>
async fn text_to_speech( &self, _request: SpeechRequest, _context: RequestContext, ) -> Result<SpeechResponse, ProviderError>
Source§async fn get_average_latency(&self) -> Result<Duration, ProviderError>
async fn get_average_latency(&self) -> Result<Duration, ProviderError>
Source§async fn get_success_rate(&self) -> Result<f32, ProviderError>
async fn get_success_rate(&self) -> Result<f32, ProviderError>
Source§async fn estimate_tokens(&self, text: &str) -> Result<u32, ProviderError>
async fn estimate_tokens(&self, text: &str) -> Result<u32, ProviderError>
Auto Trait Implementations§
impl !RefUnwindSafe for GitHubCopilotProvider
impl !UnwindSafe for GitHubCopilotProvider
impl Freeze for GitHubCopilotProvider
impl Send for GitHubCopilotProvider
impl Sync for GitHubCopilotProvider
impl Unpin for GitHubCopilotProvider
impl UnsafeUnpin for GitHubCopilotProvider
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
Source§impl<T> BudgetAwareRouting for T
impl<T> BudgetAwareRouting for T
Source§fn filter_by_budget(
&self,
providers: Vec<String>,
budget_router: &BudgetAwareRouter,
) -> Vec<String>
fn filter_by_budget( &self, providers: Vec<String>, budget_router: &BudgetAwareRouter, ) -> Vec<String>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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 moreSource§impl<T> LLMChat for Twhere
T: LLMProvider,
impl<T> LLMChat for Twhere
T: LLMProvider,
Source§async fn chat_completion(
&self,
request: ChatRequest,
context: RequestContext,
) -> Result<ChatResponse, ProviderError>
async fn chat_completion( &self, request: ChatRequest, context: RequestContext, ) -> Result<ChatResponse, ProviderError>
legacy adapter only; use LLMProvider plus ProviderCapability for runtime dispatch. Tracked under #729.
Source§async fn transform_request(
&self,
request: ChatRequest,
context: RequestContext,
) -> Result<Value, ProviderError>
async fn transform_request( &self, request: ChatRequest, context: RequestContext, ) -> Result<Value, ProviderError>
legacy adapter only; use LLMProvider plus ProviderCapability for runtime dispatch. Tracked under #729.
Source§async fn transform_response(
&self,
raw_response: &[u8],
model: &str,
request_id: &str,
) -> Result<ChatResponse, ProviderError>
async fn transform_response( &self, raw_response: &[u8], model: &str, request_id: &str, ) -> Result<ChatResponse, ProviderError>
legacy adapter only; use LLMProvider plus ProviderCapability for runtime dispatch. Tracked under #729.
Source§async fn map_openai_params(
&self,
params: HashMap<String, Value>,
model: &str,
) -> Result<HashMap<String, Value>, ProviderError>
async fn map_openai_params( &self, params: HashMap<String, Value>, model: &str, ) -> Result<HashMap<String, Value>, ProviderError>
legacy adapter only; use LLMProvider plus ProviderCapability for runtime dispatch. Tracked under #729.
Source§fn get_supported_openai_params(&self, model: &str) -> &'static [&'static str]
fn get_supported_openai_params(&self, model: &str) -> &'static [&'static str]
legacy adapter only; use LLMProvider plus ProviderCapability for runtime dispatch. Tracked under #729.
Source§impl<T> LLMEmbed for Twhere
T: LLMProvider,
impl<T> LLMEmbed for Twhere
T: LLMProvider,
Source§async fn embeddings(
&self,
request: EmbeddingRequest,
context: RequestContext,
) -> Result<EmbeddingResponse, ProviderError>
async fn embeddings( &self, request: EmbeddingRequest, context: RequestContext, ) -> Result<EmbeddingResponse, ProviderError>
legacy adapter only; use LLMProvider plus ProviderCapability for runtime dispatch. Tracked under #729.
Source§impl<T> LLMStream for Twhere
T: LLMProvider,
impl<T> LLMStream for Twhere
T: LLMProvider,
Source§async fn chat_completion_stream(
&self,
request: ChatRequest,
context: RequestContext,
) -> Result<Pin<Box<dyn Stream<Item = Result<ChatChunk, ProviderError>> + Send>>, ProviderError>
async fn chat_completion_stream( &self, request: ChatRequest, context: RequestContext, ) -> Result<Pin<Box<dyn Stream<Item = Result<ChatChunk, ProviderError>> + Send>>, ProviderError>
legacy adapter only; use LLMProvider plus ProviderCapability for runtime dispatch. Tracked under #729.