Skip to main content

gemini_builder

Function gemini_builder 

Source
pub fn gemini_builder(
    model: &str,
    api_key: Option<&str>,
) -> Result<GeminiBuilder>
Expand description

Create a Gemini agent builder

§Arguments

  • model - The model name to use
  • api_key - Optional API key from config. Resolution order:
    1. Non-empty api_key parameter (from config)
    2. GOOGLE_API_KEY environment variable
    3. Client’s from_env() (requires env var to be set)

§Errors

Returns an error if client creation fails (invalid credentials or missing env var).

§Security

Error messages are sanitized to prevent potential API key exposure.