pub struct CopilotProxyPlugin { /* private fields */ }Expand description
High-level Copilot Proxy plugin wrapper.
Implementations§
Source§impl CopilotProxyPlugin
impl CopilotProxyPlugin
Sourcepub fn new(config: CopilotProxyConfig) -> Result<Self>
pub fn new(config: CopilotProxyConfig) -> Result<Self>
Create a new plugin with the given configuration.
Sourcepub async fn initialize(&self) -> Result<()>
pub async fn initialize(&self) -> Result<()>
Initialize the plugin.
Sourcepub async fn is_available(&self) -> bool
pub async fn is_available(&self) -> bool
Check if the plugin is available.
Sourcepub async fn generate_text(&self, prompt: &str) -> Result<String>
pub async fn generate_text(&self, prompt: &str) -> Result<String>
Generate text using the default (large) model.
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.
Sourcepub async fn generate_object_small(&self, prompt: &str) -> Result<Value>
pub async fn generate_object_small(&self, prompt: &str) -> Result<Value>
Generate a JSON object using the small model.
Sourcepub async fn generate_object_large(&self, prompt: &str) -> Result<Value>
pub async fn generate_object_large(&self, prompt: &str) -> Result<Value>
Generate a JSON object using the large model.
Sourcepub fn provider(&self) -> &CopilotProxyModelProvider
pub fn provider(&self) -> &CopilotProxyModelProvider
Get the model provider.
Auto Trait Implementations§
impl Freeze for CopilotProxyPlugin
impl !RefUnwindSafe for CopilotProxyPlugin
impl Send for CopilotProxyPlugin
impl Sync for CopilotProxyPlugin
impl Unpin for CopilotProxyPlugin
impl UnsafeUnpin for CopilotProxyPlugin
impl !UnwindSafe for CopilotProxyPlugin
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