Skip to main content

GitHubCopilotProvider

Struct GitHubCopilotProvider 

Source
pub struct GitHubCopilotProvider { /* private fields */ }
Expand description

GitHub Copilot provider implementation

Implementations§

Source§

impl GitHubCopilotProvider

Source

pub async fn new(config: GitHubCopilotConfig) -> Result<Self, ProviderError>

Create a new GitHub Copilot provider instance

Trait Implementations§

Source§

impl Clone for GitHubCopilotProvider

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GitHubCopilotProvider

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl LLMProvider for GitHubCopilotProvider

Source§

fn name(&self) -> &'static str

Get provider name Read more
Source§

fn capabilities(&self) -> &'static [ProviderCapability]

Get provider capabilities Read more
Source§

fn models(&self) -> &[ModelInfo]

Get supported model list Read more
Source§

fn get_supported_openai_params(&self, model: &str) -> &'static [&'static str]

Get supported OpenAI parameters Read more
Source§

async fn map_openai_params( &self, params: HashMap<String, Value>, _model: &str, ) -> Result<HashMap<String, Value>, ProviderError>

Map OpenAI parameters to provider-specific parameters Read more
Source§

async fn transform_request( &self, request: ChatRequest, _context: RequestContext, ) -> Result<Value, ProviderError>

Transform request format Read more
Source§

async fn transform_response( &self, raw_response: &[u8], _model: &str, _request_id: &str, ) -> Result<ChatResponse, ProviderError>

Transform response format Read more
Source§

fn get_error_mapper(&self) -> Box<dyn ErrorMapper<ProviderError>>

Get error mapper instance Read more
Source§

async fn chat_completion( &self, request: ChatRequest, _context: RequestContext, ) -> Result<ChatResponse, ProviderError>

Execute chat completion request Read more
Source§

async fn chat_completion_stream( &self, request: ChatRequest, _context: RequestContext, ) -> Result<Pin<Box<dyn Stream<Item = Result<ChatChunk, ProviderError>> + Send>>, ProviderError>

Execute streaming chat completion request Read more
Source§

async fn embeddings( &self, request: EmbeddingRequest, _context: RequestContext, ) -> Result<EmbeddingResponse, ProviderError>

Generate text embeddings Read more
Source§

async fn health_check(&self) -> HealthStatus

Check provider health status Read more
Source§

async fn calculate_cost( &self, _model: &str, _input_tokens: u32, _output_tokens: u32, ) -> Result<f64, ProviderError>

Calculate request cost Read more
Source§

fn error_provider_name(&self) -> &'static str

Static provider name used by legacy ProviderError constructors. Read more
Source§

fn supports_capability(&self, capability: &ProviderCapability) -> bool

Check if this provider declares a runtime capability. Read more
Source§

fn supports_model(&self, model: &str) -> bool

Check if model is supported Read more
Source§

fn supports_tools(&self) -> bool

Check if tools are supported Read more
Source§

fn supports_streaming(&self) -> bool

Check if streaming is supported Read more
Source§

fn supports_image_generation(&self) -> bool

Check if image generation is supported Read more
Source§

fn supports_embeddings(&self) -> bool

Check if embeddings are supported Read more
Source§

fn supports_vision(&self) -> bool

Check if vision capabilities are supported Read more
Source§

async fn image_generation( &self, _request: ImageGenerationRequest, _context: RequestContext, ) -> Result<ImageGenerationResponse, ProviderError>

Generate images Read more
Source§

async fn image_edit( &self, _request: ImageEditRequest, _context: RequestContext, ) -> Result<ImageGenerationResponse, ProviderError>

Edit an image through a provider-native image editing endpoint.
Source§

async fn audio_transcription( &self, _request: TranscriptionRequest, _context: RequestContext, ) -> Result<TranscriptionResponse, ProviderError>

Transcribe audio to text. Read more
Source§

async fn audio_translation( &self, _request: TranslationRequest, _context: RequestContext, ) -> Result<TranslationResponse, ProviderError>

Translate audio to English text. Read more
Source§

async fn text_to_speech( &self, _request: SpeechRequest, _context: RequestContext, ) -> Result<SpeechResponse, ProviderError>

Generate speech audio from text. Read more
Source§

async fn get_average_latency(&self) -> Result<Duration, ProviderError>

Get average response latency Read more
Source§

async fn get_success_rate(&self) -> Result<f32, ProviderError>

Get success rate Read more
Source§

async fn estimate_tokens(&self, text: &str) -> Result<u32, ProviderError>

Estimate token count for text Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> BudgetAwareRouting for T

Source§

fn filter_by_budget( &self, providers: Vec<String>, budget_router: &BudgetAwareRouter, ) -> Vec<String>

Filter providers based on budget availability
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
Source§

impl<T> LLMChat for T
where T: LLMProvider,

Source§

async fn chat_completion( &self, request: ChatRequest, context: RequestContext, ) -> Result<ChatResponse, ProviderError>

👎Deprecated since 0.5.1:

legacy adapter only; use LLMProvider plus ProviderCapability for runtime dispatch. Tracked under #729.

Execute chat completion request.
Source§

async fn transform_request( &self, request: ChatRequest, context: RequestContext, ) -> Result<Value, ProviderError>

👎Deprecated since 0.5.1:

legacy adapter only; use LLMProvider plus ProviderCapability for runtime dispatch. Tracked under #729.

Transform a standard ChatRequest into provider-specific format.
Source§

async fn transform_response( &self, raw_response: &[u8], model: &str, request_id: &str, ) -> Result<ChatResponse, ProviderError>

👎Deprecated since 0.5.1:

legacy adapter only; use LLMProvider plus ProviderCapability for runtime dispatch. Tracked under #729.

Transform raw provider response bytes into a ChatResponse.
Source§

async fn map_openai_params( &self, params: HashMap<String, Value>, model: &str, ) -> Result<HashMap<String, Value>, ProviderError>

👎Deprecated since 0.5.1:

legacy adapter only; use LLMProvider plus ProviderCapability for runtime dispatch. Tracked under #729.

Map OpenAI parameters to provider-specific parameters.
Source§

fn get_supported_openai_params(&self, model: &str) -> &'static [&'static str]

👎Deprecated since 0.5.1:

legacy adapter only; use LLMProvider plus ProviderCapability for runtime dispatch. Tracked under #729.

Get supported OpenAI parameters for a model.
Source§

impl<T> LLMEmbed for T
where T: LLMProvider,

Source§

async fn embeddings( &self, request: EmbeddingRequest, context: RequestContext, ) -> Result<EmbeddingResponse, ProviderError>

👎Deprecated since 0.5.1:

legacy adapter only; use LLMProvider plus ProviderCapability for runtime dispatch. Tracked under #729.

Generate text embeddings.
Source§

impl<T> LLMStream for T
where T: LLMProvider,

Source§

async fn chat_completion_stream( &self, request: ChatRequest, context: RequestContext, ) -> Result<Pin<Box<dyn Stream<Item = Result<ChatChunk, ProviderError>> + Send>>, ProviderError>

👎Deprecated since 0.5.1:

legacy adapter only; use LLMProvider plus ProviderCapability for runtime dispatch. Tracked under #729.

Execute streaming chat completion request.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SharedResource for T
where T: Send + Sync + 'static,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more