pub struct CopilotProxyClient { /* private fields */ }Expand description
HTTP client for interacting with the Copilot Proxy server.
Implementations§
Source§impl CopilotProxyClient
impl CopilotProxyClient
Sourcepub fn new(config: CopilotProxyConfig) -> Result<Self>
pub fn new(config: CopilotProxyConfig) -> Result<Self>
Create a new Copilot Proxy client.
Sourcepub fn config(&self) -> &CopilotProxyConfig
pub fn config(&self) -> &CopilotProxyConfig
Get the configuration.
Sourcepub async fn list_models(&self) -> Result<ModelsResponse>
pub async fn list_models(&self) -> Result<ModelsResponse>
List available models.
Sourcepub async fn health_check(&self) -> bool
pub async fn health_check(&self) -> bool
Check if the proxy server is available.
Sourcepub async fn create_chat_completion(
&self,
request: &ChatCompletionRequest,
) -> Result<ChatCompletionResponse>
pub async fn create_chat_completion( &self, request: &ChatCompletionRequest, ) -> Result<ChatCompletionResponse>
Create a chat completion.
Sourcepub async fn generate_text(
&self,
params: &TextGenerationParams,
) -> Result<TextGenerationResult>
pub async fn generate_text( &self, params: &TextGenerationParams, ) -> Result<TextGenerationResult>
Generate text using the chat completion API.
Sourcepub async fn generate_text_small(&self, prompt: &str) -> Result<String>
pub async fn generate_text_small(&self, prompt: &str) -> Result<String>
Generate text using the small model.
Sourcepub async fn generate_text_large(&self, prompt: &str) -> Result<String>
pub async fn generate_text_large(&self, prompt: &str) -> Result<String>
Generate text using the large model.
Auto Trait Implementations§
impl Freeze for CopilotProxyClient
impl !RefUnwindSafe for CopilotProxyClient
impl Send for CopilotProxyClient
impl Sync for CopilotProxyClient
impl Unpin for CopilotProxyClient
impl UnsafeUnpin for CopilotProxyClient
impl !UnwindSafe for CopilotProxyClient
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
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>
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 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>
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