pub struct ProviderIntegration {
pub current_provider: Option<String>,
pub current_model: Option<String>,
pub streaming_enabled: bool,
pub stream_handler: Option<StreamHandler>,
}Expand description
Provider integration for TUI
Fields§
§current_provider: Option<String>Current provider name
current_model: Option<String>Current model name
streaming_enabled: boolWhether streaming is enabled
stream_handler: Option<StreamHandler>Stream handler for processing tokens
Implementations§
Source§impl ProviderIntegration
impl ProviderIntegration
Sourcepub fn with_provider(provider: Option<String>, model: Option<String>) -> Self
pub fn with_provider(provider: Option<String>, model: Option<String>) -> Self
Create with specific provider and model
Sourcepub fn set_streaming_enabled(&mut self, enabled: bool)
pub fn set_streaming_enabled(&mut self, enabled: bool)
Enable or disable streaming
Sourcepub fn is_streaming_enabled(&self) -> bool
pub fn is_streaming_enabled(&self) -> bool
Check if streaming is enabled
Sourcepub fn set_stream_handler(&mut self, handler: StreamHandler)
pub fn set_stream_handler(&mut self, handler: StreamHandler)
Set the stream handler for processing tokens
Sourcepub fn handle_token(&self, token: String)
pub fn handle_token(&self, token: String)
Handle a streamed token
Sourcepub fn set_provider(&mut self, provider: String)
pub fn set_provider(&mut self, provider: String)
Set the current provider
Sourcepub fn has_provider(&self) -> bool
pub fn has_provider(&self) -> bool
Check if a provider is configured
Sourcepub fn provider_display_name(&self) -> String
pub fn provider_display_name(&self) -> String
Get provider display name
Sourcepub fn model_display_name(&self) -> String
pub fn model_display_name(&self) -> String
Get model display name
Sourcepub fn info_string(&self) -> String
pub fn info_string(&self) -> String
Get full provider info string
Sourcepub fn available_providers() -> Vec<&'static str>
pub fn available_providers() -> Vec<&'static str>
List available providers
Sourcepub fn available_models_for_provider(provider: &str) -> Vec<&'static str>
pub fn available_models_for_provider(provider: &str) -> Vec<&'static str>
List available models for a provider
Trait Implementations§
Source§impl Clone for ProviderIntegration
impl Clone for ProviderIntegration
Auto Trait Implementations§
impl Freeze for ProviderIntegration
impl !RefUnwindSafe for ProviderIntegration
impl Send for ProviderIntegration
impl Sync for ProviderIntegration
impl Unpin for ProviderIntegration
impl !UnwindSafe for ProviderIntegration
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> 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>
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