mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Python: Fix Gemini client support for Gemini API and Vertex AI (#5258)
* Add Gemini and Vertex AI client support Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Address Gemini PR review feedback Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * removed sample run readme part --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Evan Mattson <35585003+moonbox3@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
Unverified
parent
c14beedb3a
commit
90a633967c
@@ -12,11 +12,28 @@ The Gemini integration enables Microsoft Agent Framework applications to call Go
|
||||
|
||||
## Authentication
|
||||
|
||||
Obtain an API key from [Google AI Studio](https://aistudio.google.com/apikey) and set it via environment variable:
|
||||
The connector supports both `google-genai` authentication modes.
|
||||
|
||||
### Gemini Developer API
|
||||
|
||||
Obtain an API key from [Google AI Studio](https://aistudio.google.com/apikey) and set either the package-prefixed or SDK-standard environment variable:
|
||||
|
||||
```bash
|
||||
export GEMINI_API_KEY="your-api-key"
|
||||
export GEMINI_MODEL="gemini-2.5-flash"
|
||||
# or: export GOOGLE_API_KEY="your-api-key"
|
||||
export GEMINI_MODEL="gemini-2.5-flash-lite"
|
||||
# or: export GOOGLE_MODEL="gemini-2.5-flash-lite"
|
||||
```
|
||||
|
||||
### Vertex AI
|
||||
|
||||
Set the standard Vertex AI environment variables used by `google-genai`:
|
||||
|
||||
```bash
|
||||
export GOOGLE_GENAI_USE_VERTEXAI=true
|
||||
export GOOGLE_CLOUD_PROJECT="your-project-id"
|
||||
export GOOGLE_CLOUD_LOCATION="global"
|
||||
export GOOGLE_MODEL="gemini-2.5-flash-lite"
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
Reference in New Issue
Block a user