Skip to content
Merged
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 @@ -61,7 +61,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
4 changes: 2 additions & 2 deletions docs/agents/models/agent-platform.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,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 @@ -278,7 +278,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/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
```

For more information on connecting to Google Cloud from ADK agents, see
Expand Down Expand Up @@ -327,7 +327,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 @@ -570,7 +570,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 Python agent is a FastAPI application that uses `Gemini Flash` as the LLM. The Go agent uses the ADK launcher and a statically-linked binary in a minimal container. We can use Vertex AI or AI Studio as the LLM provider.
In this example deploys a simple agent to GKE. The Python agent is a FastAPI application that uses `Gemini Flash` as the LLM. The Go agent uses the ADK launcher and a statically-linked binary in a minimal container. We can use Vertex AI or AI Studio as the LLM provider. You can use Agent Platform or AI Studio as the LLM provider with 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 @@ -479,9 +479,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 @@ -146,7 +146,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 @@ -274,7 +274,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 @@ -1674,7 +1674,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
2 changes: 1 addition & 1 deletion examples/java/demos/patent-search-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Using ADK Java SDK to perform the popular Patent Search (Contextual Search) use

2. Set env variables:
```
export GOOGLE_GENAI_USE_VERTEXAI=FALSE
export GOOGLE_GENAI_USE_ENTERPRISE=FALSE
export GOOGLE_API_KEY="<your-api-key>"
```
3. Update the placeholders in the code with values from your project (like PROJECT_ID etc.)
Expand Down
2 changes: 1 addition & 1 deletion examples/python/notebooks/express-mode-weather-agent.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"express_mode_api_key = \"YOUR-EXPRESS-MODE-API-KEY\" # @param {type:\"string\"}\n",
"os.environ[\"GOOGLE_API_KEY\"] = express_mode_api_key\n",
"# Set vertex to true\n",
"os.environ[\"GOOGLE_GENAI_USE_VERTEXAI\"] = \"True\"\n",
"os.environ[\"GOOGLE_GENAI_USE_ENTERPRISE\"] = \"True\"\n",
"\n",
"# --- Verify Keys (Optional Check) ---\n",
"print(\"API Keys Set:\")\n",
Expand Down
4 changes: 2 additions & 2 deletions examples/python/notebooks/shop_agent.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,14 @@
"from getpass import getpass\n",
"\n",
"# Set environment variables required for running ADK (with Gemini API Key)\n",
"os.environ[\"GOOGLE_GENAI_USE_VERTEXAI\"] = \"False\"\n",
"os.environ[\"GOOGLE_GENAI_USE_ENTERPRISE\"] = \"False\"\n",
"os.environ[\"GOOGLE_API_KEY\"] = getpass(\"Enter your Gemini API Key: \")\n",
"\n",
"# To use Agent Platform instead of Gemini API Key in Colab Enterprise or Cloud Workbench, use the following:\n",
"# [PROJECT_ID] = !gcloud config list --format \"value(core.project)\"\n",
"# os.environ[\"GOOGLE_CLOUD_PROJECT\"] = PROJECT_ID\n",
"# os.environ[\"GOOGLE_CLOUD_LOCATION\"] = \"us-central1\"\n",
"# os.environ[\"GOOGLE_GENAI_USE_VERTEXAI\"] = \"True\""
"# os.environ[\"GOOGLE_GENAI_USE_ENTERPRISE\"] = \"True\""
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
## Configuration

```env
GOOGLE_GENAI_USE_VERTEXAI=TRUE
GOOGLE_GENAI_USE_ENTERPRISE=TRUE
GOOGLE_CLOUD_PROJECT=gcp-samples-ic0
GOOGLE_CLOUD_LOCATION=us-central1
DEMO_AGENT_MODEL=gemini-live-2.5-flash-preview-native-audio-09-2025
Expand Down
2 changes: 1 addition & 1 deletion examples/python/tutorial/agent_team/adk-tutorial/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Before running any agent step, you **must** configure your API keys.
**Example `.env` content:**
```dotenv
# Set to False to use API keys directly (required for multi-model)
GOOGLE_GENAI_USE_VERTEXAI=FALSE
GOOGLE_GENAI_USE_ENTERPRISE=FALSE

# --- Replace with your actual keys ---
GOOGLE_API_KEY=PASTE_YOUR_ACTUAL_GOOGLE_API_KEY_HERE
Expand Down
2 changes: 1 addition & 1 deletion examples/python/tutorial/agent_team/adk_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
")\n",
"\n",
"# Configure ADK to use API keys directly (not Agent Platform for this multi-model setup)\n",
"os.environ[\"GOOGLE_GENAI_USE_VERTEXAI\"] = \"False\"\n",
"os.environ[\"GOOGLE_GENAI_USE_ENTERPRISE\"] = \"False\"\n",
"\n",
"\n",
"# @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