Skip to content

Commit ef1dae0

Browse files
authored
vertex-ai-update-ag-2929 (#188)
Changes: - Updated docs for using VertexAI with Gemini
1 parent b29c890 commit ef1dae0

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

models/google.mdx

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,33 @@ setx GOOGLE_API_KEY ***
3434

3535
To use Vertex AI:
3636

37-
1. Install Google Cloud CLI and authenticate:
37+
1. Install Google Cloud CLI and authenticate. More details [here](https://cloud.google.com/vertex-ai/generative-ai/docs/start/quickstarts/quickstart-multimodal#setup-local).
38+
3839
```bash
3940
gcloud auth application-default login
4041
```
4142

42-
2. Set your project ID (optional if `GOOGLE_CLOUD_PROJECT` is set):
43+
2. Enable Vertex AI API and set variables:
44+
45+
Export the following variables:
46+
4347
```bash
44-
export GOOGLE_CLOUD_PROJECT=your-project-id
48+
export GOOGLE_GENAI_USE_VERTEXAI="true"
49+
export GOOGLE_CLOUD_PROJECT="your-gcloud-project-id"
50+
export GOOGLE_CLOUD_LOCATION="your-gcloud-location"
51+
```
52+
53+
Or update your Agent configuration:
54+
55+
```python
56+
agent = Agent(
57+
model=Gemini(
58+
id="gemini-1.5-flash",
59+
vertexai=True,
60+
project_id="your-gcloud-project-id",
61+
location="your-gcloud-location",
62+
),
63+
)
4564
```
4665

4766
## Example
@@ -81,7 +100,7 @@ agent.print_response("Share a 2 sentence horror story.")
81100

82101
## Grounding and Search
83102

84-
Gemini models support grounding and search capabilities through optional parameters. This automatically sends tools for grounding or search to Gemini. See more details [here](https://ai.google.dev/gemini-api/docs/grounding?lang=python).
103+
Gemini models support grounding and search capabilities through optional parameters. This automatically sends tools for grounding or search to Gemini. See more details [here](https://ai.google.dev/gemini-api/docs/grounding?lang=python).
85104

86105
To enable these features, set the corresponding parameter when initializing the Gemini model:
87106

0 commit comments

Comments
 (0)