Struct GeminiLlm
pub struct GeminiLlm { /* private fields */ }Expand description
Concrete Gemini LLM implementation using gemini-live Client.
The gemini-live Client is created once at construction time and reused for
all generate() calls, matching the JS GenAI SDK pattern where a single
GoogleGenAI instance is shared across requests.
Implementations§
§impl GeminiLlm
impl GeminiLlm
pub fn new(params: GeminiLlmParams) -> GeminiLlm
pub fn new(params: GeminiLlmParams) -> GeminiLlm
Create a new GeminiLlm from parameters.
Resolves defaults for model, variant, API key, project, and location
from parameters first, then falls back to environment variables.
The gemini-live Client is created once here and reused for all calls.
pub fn is_supported(model: &str) -> bool
pub fn is_supported(model: &str) -> bool
Check if a model name is supported by GeminiLlm.
pub fn variant(&self) -> GoogleLlmVariant
pub fn variant(&self) -> GoogleLlmVariant
Get the variant (VertexAI vs GeminiApi).
Trait Implementations§
§impl BaseLlm for GeminiLlm
impl BaseLlm for GeminiLlm
§fn warm_up<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), LlmError>> + Send + 'async_trait>>where
'life0: 'async_trait,
GeminiLlm: 'async_trait,
fn warm_up<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), LlmError>> + Send + 'async_trait>>where
'life0: 'async_trait,
GeminiLlm: 'async_trait,
Pre-warm the HTTP connection pool by making a lightweight request.
Establishes the TCP+TLS connection so the first real generate()
call doesn’t pay the ~100-300ms handshake penalty. reqwest’s
connection pool keeps it alive for subsequent calls.