pub struct GeminiProvider { /* private fields */ }Implementations§
Source§impl GeminiProvider
impl GeminiProvider
Sourcepub fn supports_caching(model: &str) -> bool
pub fn supports_caching(model: &str) -> bool
Check if model supports context caching
Sourcepub fn supports_code_execution(model: &str) -> bool
pub fn supports_code_execution(model: &str) -> bool
Check if model supports code execution
Sourcepub fn max_input_tokens(model: &str) -> usize
pub fn max_input_tokens(model: &str) -> usize
Get maximum input token limit for a model
Sourcepub fn max_output_tokens(model: &str) -> usize
pub fn max_output_tokens(model: &str) -> usize
Get maximum output token limit for a model
Source§impl GeminiProvider
impl GeminiProvider
pub fn new(api_key: String) -> Self
pub fn with_model(api_key: String, model: String) -> Self
pub fn new_with_client( api_key: String, model: String, http_client: Client, base_url: String, timeouts: TimeoutsConfig, prompt_cache_enabled: bool, prompt_cache_settings: GeminiPromptCacheSettings, ) -> Self
pub fn from_config( api_key: Option<String>, model: Option<String>, base_url: Option<String>, prompt_cache: Option<PromptCachingConfig>, timeouts: Option<TimeoutsConfig>, _anthropic: Option<AnthropicConfig>, model_behavior: Option<ModelConfig>, ) -> Self
Trait Implementations§
Source§impl LLMClient for GeminiProvider
impl LLMClient for GeminiProvider
Source§impl LLMProvider for GeminiProvider
impl LLMProvider for GeminiProvider
Source§fn supports_streaming(&self) -> bool
fn supports_streaming(&self) -> bool
Whether the provider has native streaming support
Source§fn supports_non_streaming(&self, _model: &str) -> bool
fn supports_non_streaming(&self, _model: &str) -> bool
Whether the provider can service non-streaming generation requests for the model.
Source§fn supports_reasoning(&self, model: &str) -> bool
fn supports_reasoning(&self, model: &str) -> bool
Whether the provider surfaces structured reasoning traces for the given model
Source§fn supports_reasoning_effort(&self, model: &str) -> bool
fn supports_reasoning_effort(&self, model: &str) -> bool
Whether the provider accepts configurable reasoning effort for the model
Source§fn supports_context_caching(&self, model: &str) -> bool
fn supports_context_caching(&self, model: &str) -> bool
Whether the provider supports prompt/context caching
Source§fn effective_context_size(&self, model: &str) -> usize
fn effective_context_size(&self, model: &str) -> usize
Get the effective context window size for a model. Read more
Source§fn generate<'life0, 'async_trait>(
&'life0 self,
request: LLMRequest,
) -> Pin<Box<dyn Future<Output = Result<LLMResponse, LLMError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn generate<'life0, 'async_trait>(
&'life0 self,
request: LLMRequest,
) -> Pin<Box<dyn Future<Output = Result<LLMResponse, LLMError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Generate completion
Source§fn stream<'life0, 'async_trait>(
&'life0 self,
request: LLMRequest,
) -> Pin<Box<dyn Future<Output = Result<LLMStream, LLMError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stream<'life0, 'async_trait>(
&'life0 self,
request: LLMRequest,
) -> Pin<Box<dyn Future<Output = Result<LLMStream, LLMError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stream completion (optional)
Source§fn stream_normalized<'life0, 'async_trait>(
&'life0 self,
request: LLMRequest,
) -> Pin<Box<dyn Future<Output = Result<LLMNormalizedStream, LLMError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stream_normalized<'life0, 'async_trait>(
&'life0 self,
request: LLMRequest,
) -> Pin<Box<dyn Future<Output = Result<LLMNormalizedStream, LLMError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Normalized streaming contract layered on top of the legacy provider stream.
Source§fn supported_models(&self) -> Vec<String>
fn supported_models(&self) -> Vec<String>
Get supported models
Source§fn validate_request(&self, request: &LLMRequest) -> Result<(), LLMError>
fn validate_request(&self, request: &LLMRequest) -> Result<(), LLMError>
Validate request for this provider
Source§fn backend_kind(&self) -> BackendKind
fn backend_kind(&self) -> BackendKind
The canonical backend kind for this provider. Read more
Source§fn supported_reasoning_efforts(&self, model: &str) -> &'static [&'static str]
fn supported_reasoning_efforts(&self, model: &str) -> &'static [&'static str]
Exact levels accepted by this route; providers may override catalog metadata.
Source§fn sampling_overrides(&self, _model: &str) -> SamplingOverrides
fn sampling_overrides(&self, _model: &str) -> SamplingOverrides
Provider/model-specific sampling parameter overrides. Read more
Source§fn supports_tools(&self, _model: &str) -> bool
fn supports_tools(&self, _model: &str) -> bool
Whether the provider supports structured tool calling for the given model
Source§fn supports_parallel_tool_config(&self, _model: &str) -> bool
fn supports_parallel_tool_config(&self, _model: &str) -> bool
Whether the provider understands parallel tool configuration payloads
Source§fn supports_structured_output(&self, _model: &str) -> bool
fn supports_structured_output(&self, _model: &str) -> bool
Whether the provider supports structured output (JSON schema guarantees)
Source§fn supports_vision(&self, _model: &str) -> bool
fn supports_vision(&self, _model: &str) -> bool
Whether the provider supports vision (image analysis) for given model
Source§fn supports_responses_compaction(&self, _model: &str) -> bool
fn supports_responses_compaction(&self, _model: &str) -> bool
Whether the provider supports Responses API server-side compaction.
Source§fn supports_native_allowed_tools(&self, _model: &str) -> bool
fn supports_native_allowed_tools(&self, _model: &str) -> bool
Whether the request path can enforce a provider-native
allowed_tools subset.Source§fn supports_context_edits(&self, _model: &str) -> bool
fn supports_context_edits(&self, _model: &str) -> bool
Whether the provider supports provider-native context editing such as
tool-result clearing.
Source§fn supports_turn_scoped_system_messages(&self, _model: &str) -> bool
fn supports_turn_scoped_system_messages(&self, _model: &str) -> bool
Whether the selected provider/model can carry Anthropic’s native
turn-scoped system-message lifecycle field on the wire. Read more
Source§fn supports_manual_openai_compaction(&self, _model: &str) -> bool
fn supports_manual_openai_compaction(&self, _model: &str) -> bool
Whether the provider supports the interactive manual
/compact command path. Read moreSource§fn supports_native_inline_compaction(&self, _model: &str) -> bool
fn supports_native_inline_compaction(&self, _model: &str) -> bool
Whether the provider supports threshold-triggered inline compaction via
request fields (Anthropic
compact_20260112). Read moreSource§fn compact_history<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_model: &'life1 str,
_history: &'life2 [Message],
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>, LLMError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn compact_history<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_model: &'life1 str,
_history: &'life2 [Message],
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>, LLMError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Compact conversation history using provider-native Responses
/compact
support when available.Source§fn compact_history_with_options<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_model: &'life1 str,
_history: &'life2 [Message],
_options: &'life3 ResponsesCompactionOptions,
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>, LLMError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn compact_history_with_options<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_model: &'life1 str,
_history: &'life2 [Message],
_options: &'life3 ResponsesCompactionOptions,
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>, LLMError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Compact conversation history with standalone Responses compaction options.
Source§fn start_copilot_prompt_session<'a>(
&'a self,
_request: LLMRequest,
_tools: &'a [ToolDefinition],
) -> Option<CopilotPromptSessionFuture<'a>>
fn start_copilot_prompt_session<'a>( &'a self, _request: LLMRequest, _tools: &'a [ToolDefinition], ) -> Option<CopilotPromptSessionFuture<'a>>
Provider-specific streaming path that can service interactive runtime
requests while the stream is active. Copilot uses this to bridge ACP
tool calls and permission prompts back into VT Code’s turn runtime.
Auto Trait Implementations§
impl !Freeze for GeminiProvider
impl !RefUnwindSafe for GeminiProvider
impl !UnwindSafe for GeminiProvider
impl Send for GeminiProvider
impl Sync for GeminiProvider
impl Unpin for GeminiProvider
impl UnsafeUnpin for GeminiProvider
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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> 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