Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/update-python-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.ADK_BOT_GITHUB_TOKEN }}
GOOGLE_CLOUD_PROJECT: ${{ secrets.GOOGLE_CLOUD_PROJECT }}
GOOGLE_CLOUD_LOCATION: ${{ secrets.GOOGLE_CLOUD_LOCATION }}
GOOGLE_GENAI_USE_VERTEXAI: 1
GOOGLE_GENAI_USE_ENTERPRISE: 1
DOC_OWNER: 'google'
DOC_REPO: 'adk-docs'
CODE_OWNER: 'google'
Expand Down
4 changes: 2 additions & 2 deletions docs/agents/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ To create an ADK project for use with Agent Config:
1. For Gemini model access through Google API, add a line to the
file with your API key:

GOOGLE_GENAI_USE_VERTEXAI=0
GOOGLE_GENAI_USE_ENTERPRISE=0
GOOGLE_API_KEY=<your-Google-Gemini-API-key>

You can get an API key from the Google AI Studio
[API Keys](https://aistudio.google.com/app/apikey) page.

1. For Gemini model access through Google Cloud, add these lines to the file:

GOOGLE_GENAI_USE_VERTEXAI=1
GOOGLE_GENAI_USE_ENTERPRISE=1
GOOGLE_CLOUD_PROJECT=<your_gcp_project>
GOOGLE_CLOUD_LOCATION=us-central1

Expand Down
6 changes: 3 additions & 3 deletions docs/agents/models/agent-platform.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Ensure your environment is configured for Agent Platform:
targets Agent Platform:

```shell
export GOOGLE_GENAI_USE_VERTEXAI=TRUE
export GOOGLE_GENAI_USE_ENTERPRISE=TRUE
```

## Model Garden Deployments
Expand Down Expand Up @@ -165,7 +165,7 @@ Agent Platform.
**Setup:**

1. **Agent Platform Environment:** Ensure the consolidated Agent Platform setup (ADC, Env
Vars, `GOOGLE_GENAI_USE_VERTEXAI=TRUE`) is complete.
Vars, `GOOGLE_GENAI_USE_ENTERPRISE=TRUE`) is complete.

2. **Install Provider Library:** Install the necessary client library configured
for Agent Platform.
Expand Down Expand Up @@ -296,7 +296,7 @@ Agent Platform offers a curated selection of open-source models, such as Meta Ll
**Setup:**

1. **Agent Platform Environment:** Ensure the consolidated Agent Platform setup (ADC, Env
Vars, `GOOGLE_GENAI_USE_VERTEXAI=TRUE`) is complete.
Vars, `GOOGLE_GENAI_USE_ENTERPRISE=TRUE`) is complete.

2. **Install LiteLLM:**
```shell
Expand Down
6 changes: 3 additions & 3 deletions docs/agents/models/google-gemini.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ This is the simplest method and is recommended for getting started quickly.

```shell
export GOOGLE_API_KEY="YOUR_GOOGLE_API_KEY"
export GOOGLE_GENAI_USE_VERTEXAI=FALSE
export GOOGLE_GENAI_USE_ENTERPRISE=FALSE
```

(or)
Expand Down Expand Up @@ -165,7 +165,7 @@ For scalable and production-oriented use cases, Agent Platform is the recommende
Explicitly tell the library to use Agent Platform:

```shell
export GOOGLE_GENAI_USE_VERTEXAI=TRUE
export GOOGLE_GENAI_USE_ENTERPRISE=TRUE
```

4. **Models:** Find available model IDs in the
Expand All @@ -178,7 +178,7 @@ For scalable and production-oriented use cases, Agent Platform is the recommende
2. **Set environment variables:**
```shell
export GOOGLE_GENAI_API_KEY="PASTE_YOUR_EXPRESS_MODE_API_KEY_HERE"
export GOOGLE_GENAI_USE_VERTEXAI=TRUE
export GOOGLE_GENAI_USE_ENTERPRISE=TRUE
```

### **Method C: Service Account (for Production & Automation)**
Expand Down
8 changes: 4 additions & 4 deletions docs/deploy/cloud-run.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Set your environment variables as described in the [Setup and Installation](../g
```bash
export GOOGLE_CLOUD_PROJECT=your-project-id
export GOOGLE_CLOUD_LOCATION=us-central1 # Or your preferred location
export GOOGLE_GENAI_USE_VERTEXAI=True
export GOOGLE_GENAI_USE_ENTERPRISE=True
```

_(Replace `your-project-id` with your actual GCP project ID)_
Expand All @@ -66,7 +66,7 @@ Alternatively you can also use an API key from AI Studio
```bash
export GOOGLE_CLOUD_PROJECT=your-project-id
export GOOGLE_CLOUD_LOCATION=us-central1 # Or your preferred location
export GOOGLE_GENAI_USE_VERTEXAI=FALSE
export GOOGLE_GENAI_USE_ENTERPRISE=FALSE
export GOOGLE_API_KEY=your-api-key
```
*(Replace `your-project-id` with your actual GCP project ID and `your-api-key` with your actual API key from AI Studio)*
Expand Down Expand Up @@ -336,7 +336,7 @@ unless you specify it as deployment setting, such as the `--with_ui` option for
--region $GOOGLE_CLOUD_LOCATION \
--project $GOOGLE_CLOUD_PROJECT \
--allow-unauthenticated \
--set-env-vars="GOOGLE_CLOUD_PROJECT=$GOOGLE_CLOUD_PROJECT,GOOGLE_CLOUD_LOCATION=$GOOGLE_CLOUD_LOCATION,GOOGLE_GENAI_USE_VERTEXAI=$GOOGLE_GENAI_USE_VERTEXAI"
--set-env-vars="GOOGLE_CLOUD_PROJECT=$GOOGLE_CLOUD_PROJECT,GOOGLE_CLOUD_LOCATION=$GOOGLE_CLOUD_LOCATION,GOOGLE_GENAI_USE_ENTERPRISE=$GOOGLE_GENAI_USE_ENTERPRISE"
# Add any other necessary environment variables your agent might need
```

Expand Down Expand Up @@ -579,7 +579,7 @@ unless you specify it as deployment setting, such as the `--with_ui` option for
--region $GOOGLE_CLOUD_LOCATION \
--project $GOOGLE_CLOUD_PROJECT \
--allow-unauthenticated \
--set-env-vars="GOOGLE_CLOUD_PROJECT=$GOOGLE_CLOUD_PROJECT,GOOGLE_CLOUD_LOCATION=$GOOGLE_CLOUD_LOCATION,GOOGLE_GENAI_USE_VERTEXAI=$GOOGLE_GENAI_USE_VERTEXAI"
--set-env-vars="GOOGLE_CLOUD_PROJECT=$GOOGLE_CLOUD_PROJECT,GOOGLE_CLOUD_LOCATION=$GOOGLE_CLOUD_LOCATION,GOOGLE_GENAI_USE_ENTERPRISE=$GOOGLE_GENAI_USE_ENTERPRISE"
# Add any other necessary environment variables your agent might need
```

Expand Down
10 changes: 5 additions & 5 deletions docs/deploy/gke.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

To deploy your agent you will need to have a Kubernetes cluster running on GKE. You can create a cluster using the Google Cloud Console or the `gcloud` command line tool.

In this example we will deploy a simple agent to GKE. The agent will be a FastAPI application that uses `Gemini 2.0 Flash` as the LLM. We can use Agent Platform or AI Studio as the LLM provider using the Environment variable `GOOGLE_GENAI_USE_VERTEXAI`.
In this example we will deploy a simple agent to GKE. The agent will be a FastAPI application that uses `Gemini 2.0 Flash` as the LLM. We can use Agent Platform or AI Studio as the LLM provider using the Environment variable `GOOGLE_GENAI_USE_ENTERPRISE`.

## Environment variables

Expand All @@ -17,7 +17,7 @@ Set your environment variables as described in the [Setup and Installation](../g
```bash
export GOOGLE_CLOUD_PROJECT=your-project-id # Your GCP project ID
export GOOGLE_CLOUD_LOCATION=us-central1 # Or your preferred location
export GOOGLE_GENAI_USE_VERTEXAI=true # Set to true if using Agent Platform
export GOOGLE_GENAI_USE_ENTERPRISE=true # Set to true if using Agent Platform
export GOOGLE_CLOUD_PROJECT_NUMBER=$(gcloud projects describe --format json $GOOGLE_CLOUD_PROJECT | jq -r ".projectNumber")
```

Expand Down Expand Up @@ -319,9 +319,9 @@ spec:
value: $GOOGLE_CLOUD_PROJECT
- name: GOOGLE_CLOUD_LOCATION
value: $GOOGLE_CLOUD_LOCATION
- name: GOOGLE_GENAI_USE_VERTEXAI
value: "$GOOGLE_GENAI_USE_VERTEXAI"
# If using AI Studio, set GOOGLE_GENAI_USE_VERTEXAI to false and set the following:
- name: GOOGLE_GENAI_USE_ENTERPRISE
value: "$GOOGLE_GENAI_USE_ENTERPRISE"
# If using AI Studio, set GOOGLE_GENAI_USE_ENTERPRISE to false and set the following:
# - name: GOOGLE_API_KEY
# value: $GOOGLE_API_KEY
# Add any other necessary environment variables your agent might need
Expand Down
2 changes: 1 addition & 1 deletion docs/get-started/streaming/quickstart-streaming-java.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ To run the server, you’ll need to export two environment variables:
* a variable to specify we’re not using Agent Platform this time.

```shell
export GOOGLE_GENAI_USE_VERTEXAI=FALSE
export GOOGLE_GENAI_USE_ENTERPRISE=FALSE
export GOOGLE_API_KEY=YOUR_API_KEY
```

Expand Down
4 changes: 2 additions & 2 deletions docs/get-started/streaming/quickstart-streaming.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ To run the agent, choose a platform from either Google AI Studio or Google Cloud
2. Open the **`.env`** file located inside (`app/`) and copy-paste the following code.

```env title=".env"
GOOGLE_GENAI_USE_VERTEXAI=FALSE
GOOGLE_GENAI_USE_ENTERPRISE=FALSE
GOOGLE_API_KEY=PASTE_YOUR_ACTUAL_API_KEY_HERE
```

Expand All @@ -111,7 +111,7 @@ To run the agent, choose a platform from either Google AI Studio or Google Cloud
the following code and update the project ID and location.

```env title=".env"
GOOGLE_GENAI_USE_VERTEXAI=TRUE
GOOGLE_GENAI_USE_ENTERPRISE=TRUE
GOOGLE_CLOUD_PROJECT=PASTE_YOUR_ACTUAL_PROJECT_ID
GOOGLE_CLOUD_LOCATION=us-central1
```
Expand Down
2 changes: 1 addition & 1 deletion docs/grounding/grounding_with_search.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Before creating a grounded agent, you must have an existing Agent Search Data St
* For Java, ensure your application environment has Google Cloud default credentials configured (`GOOGLE_APPLICATION_CREDENTIALS`).

```env title=".env"
GOOGLE_GENAI_USE_VERTEXAI=TRUE
GOOGLE_GENAI_USE_ENTERPRISE=TRUE
GOOGLE_CLOUD_PROJECT=YOUR_PROJECT_ID
GOOGLE_CLOUD_LOCATION=LOCATION
```
Expand Down
6 changes: 3 additions & 3 deletions docs/integrations/bigquery-agent-analytics.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ shows the BigQuery view optionally created when

os.environ['GOOGLE_CLOUD_PROJECT'] = 'your-gcp-project-id'
os.environ['GOOGLE_CLOUD_LOCATION'] = 'us-central1'
os.environ['GOOGLE_GENAI_USE_VERTEXAI'] = 'True'
os.environ['GOOGLE_GENAI_USE_ENTERPRISE'] = 'True'

plugin = BigQueryAgentAnalyticsPlugin(
project_id="your-gcp-project-id",
Expand Down Expand Up @@ -222,7 +222,7 @@ LIMIT 20;
# --- CRITICAL: Set environment variables BEFORE Gemini instantiation ---
os.environ['GOOGLE_CLOUD_PROJECT'] = PROJECT_ID
os.environ['GOOGLE_CLOUD_LOCATION'] = VERTEX_LOCATION
os.environ['GOOGLE_GENAI_USE_VERTEXAI'] = 'True'
os.environ['GOOGLE_GENAI_USE_ENTERPRISE'] = 'True'

# --- Initialize the Plugin with Config ---
bq_config = BigQueryLoggerConfig(
Expand Down Expand Up @@ -1437,7 +1437,7 @@ DATASET_ID = os.environ.get("BQ_DATASET", "agent_analytics")
# region used by GOOGLE_CLOUD_LOCATION.
BQ_LOCATION = os.environ.get("BQ_LOCATION", "US")

os.environ["GOOGLE_GENAI_USE_VERTEXAI"] = "True"
os.environ["GOOGLE_GENAI_USE_ENTERPRISE"] = "True"

# --- Plugin ---
bq_analytics_plugin = BigQueryAgentAnalyticsPlugin(
Expand Down
2 changes: 1 addition & 1 deletion docs/integrations/cloud-trace.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ working_dir/

os.environ.setdefault("GOOGLE_CLOUD_PROJECT", "{your-project-id}")
os.environ.setdefault("GOOGLE_CLOUD_LOCATION", "global")
os.environ.setdefault("GOOGLE_GENAI_USE_VERTEXAI", "True")
os.environ.setdefault("GOOGLE_GENAI_USE_ENTERPRISE", "True")


# Define a tool function
Expand Down
6 changes: 3 additions & 3 deletions docs/integrations/express-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ With this approach, `Session` objects are handled as children of the
variables are set correctly, as shown below:

```env title="agent/.env"
GOOGLE_GENAI_USE_VERTEXAI=TRUE
GOOGLE_GENAI_USE_ENTERPRISE=TRUE
GOOGLE_API_KEY=PASTE_YOUR_ACTUAL_EXPRESS_MODE_API_KEY_HERE
```

Expand Down Expand Up @@ -90,7 +90,7 @@ the session object without any project or location.
```py
# Requires: pip install google-adk[vertexai]
# Plus environment variable setup:
# GOOGLE_GENAI_USE_VERTEXAI=TRUE
# GOOGLE_GENAI_USE_ENTERPRISE=TRUE
# GOOGLE_API_KEY=PASTE_YOUR_ACTUAL_EXPRESS_MODE_API_KEY_HERE
from google.adk.sessions import VertexAiSessionService

Expand Down Expand Up @@ -119,7 +119,7 @@ the memory object without any project or location.
```py
# Requires: pip install google-adk[vertexai]
# Plus environment variable setup:
# GOOGLE_GENAI_USE_VERTEXAI=TRUE
# GOOGLE_GENAI_USE_ENTERPRISE=TRUE
# GOOGLE_API_KEY=PASTE_YOUR_ACTUAL_EXPRESS_MODE_API_KEY_HERE
from google.adk.memory import VertexAiMemoryBankService

Expand Down
2 changes: 1 addition & 1 deletion docs/integrations/galileo.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Configure environment variables:

```env title="my_agent/.env"
# Gemini environment variables
GOOGLE_GENAI_USE_VERTEXAI=0
GOOGLE_GENAI_USE_ENTERPRISE=0
GOOGLE_API_KEY="YOUR_API_KEY"

# Galileo environment variables
Expand Down
10 changes: 5 additions & 5 deletions docs/streaming/dev-guide/part1.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,18 +206,18 @@ One of ADK's most powerful features is its transparent support for both [Gemini

#### How Platform Selection Works

ADK uses the `GOOGLE_GENAI_USE_VERTEXAI` environment variable to determine which Live API platform to use:
ADK uses the `GOOGLE_GENAI_USE_ENTERPRISE` environment variable to determine which Live API platform to use:

- `GOOGLE_GENAI_USE_VERTEXAI=FALSE` (or not set): Uses Gemini Live API via Google AI Studio
- `GOOGLE_GENAI_USE_VERTEXAI=TRUE`: Uses Gemini Live API (Agent Platform) via Google Cloud
- `GOOGLE_GENAI_USE_ENTERPRISE=FALSE` (or not set): Uses Gemini Live API via Google AI Studio
- `GOOGLE_GENAI_USE_ENTERPRISE=TRUE`: Uses Gemini Live API (Agent Platform) via Google Cloud

This environment variable is read by the underlying `google-genai` SDK when ADK creates the LLM connection. No code changes are needed when switching platforms—only environment configuration changes.

##### Development Phase: Gemini Live API (Google AI Studio)

```bash
# .env.development
GOOGLE_GENAI_USE_VERTEXAI=FALSE
GOOGLE_GENAI_USE_ENTERPRISE=FALSE
GOOGLE_API_KEY=your_api_key_here
```

Expand All @@ -232,7 +232,7 @@ GOOGLE_API_KEY=your_api_key_here

```bash
# .env.production
GOOGLE_GENAI_USE_VERTEXAI=TRUE
GOOGLE_GENAI_USE_ENTERPRISE=TRUE
GOOGLE_CLOUD_PROJECT=your_project_id
GOOGLE_CLOUD_LOCATION=us-central1
```
Expand Down
2 changes: 1 addition & 1 deletion docs/streaming/streaming-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Now let's define an agent that can monitor stock price changes and monitor the v
) -> AsyncGenerator[str, None]:
"""Monitor how many people are in the video streams."""
print("start monitor_video_stream!")
client = Client(vertexai=False)
client = Client(enterprise=False)
prompt_text = (
"Count the number of people in this image. Just respond with a numeric"
" number."
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/agent-team.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ print(f"OpenAI API Key set: {'Yes' if os.environ.get('OPENAI_API_KEY') and os.en
print(f"Anthropic API Key set: {'Yes' if os.environ.get('ANTHROPIC_API_KEY') and os.environ['ANTHROPIC_API_KEY'] != 'YOUR_ANTHROPIC_API_KEY' else 'No (REPLACE PLACEHOLDER!)'}")

# Configure ADK to use API keys directly (not Agent Platform for this multi-model setup)
os.environ["GOOGLE_GENAI_USE_VERTEXAI"] = "False"
os.environ["GOOGLE_GENAI_USE_ENTERPRISE"] = "False"


# @markdown **Security Note:** It's best practice to manage API keys securely (e.g., using Colab Secrets or environment variables) rather than hardcoding them directly in the notebook. Replace the placeholder strings above.
Expand Down
Loading
Loading