Module: Gemini

Defined in:
lib/llm_conductor/patches/gemini_vertex_api_key.rb

Overview

Patches the gemini-ai gem for two Vertex AI issues:

  1. api_key + Vertex AI: the gem natively supports api_key only for generative-language-api. When both project_id and api_key are present, this patch rebuilds @base_address so the key is appended as ?key=… to the correct Vertex AI endpoint.

  2. ADC (Application Default Credentials): the gem calls Google::Auth.get_application_default without a scope, which causes ‘invalid_scope` when exchanging service-account credentials for a token. This patch re-fetches the authorizer with the required cloud-platform scope.

Defined Under Namespace

Modules: Controllers