name: pwn-ai-providers-gemini description: Drive PWN::AI::Providers::Gemini from pwn_eval. license: MIT allowed-tools: [pwn, pwn_eval] metadata: bundled: true generated: false preserve: true module: PWN::AI::Providers::Gemini source: pwn/ai/providers/gemini.rb
PWN::AI::Providers::Gemini
This plugin interacts with Google's Gemini API (Generative Language). It provides methods to list models, generate completions, and chat, plus a native tool-calling adapter (chat_with_tools) for PWN::AI::Agent::Loop. API documentation: https://ai.google.dev/api Obtain an API key from https://aistudio.google.com/app/apikey
When to use
Call PWN::AI::Providers::Gemini from pwn_eval when the task needs this module.
Do not reimplement it in shell.
Catalog authentication
Use ai.gemini.key for ordinary Gemini API calls. For get_models and
get_model only, the operator can instead use their own Google Desktop app
client in a project with the Generative Language API enabled and consent for
https://www.googleapis.com/auth/generative-language.retriever. Set
ai.gemini.oauth.client_id, client_secret, optional quota_project, and
enroll: true. Run get_models in a foreground terminal for first consent;
use a browser on the same machine for the loopback PKCE callback, not pasted
codes. A cached grant can be reused or refreshed for catalog reads. There is
no Workspace, application-default or other client credential import.
How to call
PWN::AI::Providers::Gemini.get_models(non_interactive: true).length
Public methods
get_modelsget_modelchat_with_toolschatauthorshelp
References
references/urls.md— URLs from source
Source
pwn/ai/providers/gemini.rb
Verification
The number counts returned model entries. Catalog OAuth requires the official Generative Language API base and does not enable generation or establish quota.
