diff --git a/README.md b/README.md index 61625a1..f80facd 100644 --- a/README.md +++ b/README.md @@ -59,17 +59,17 @@ Replace `YOUR_GEMINI_API_KEY` with your actual key. You need to explicitly use Vertex AI, then provide project and location to use the agent: ```bash -export USE_VERTEXAI=true -export VERTEXAI_PROJECT="YOUR_PROJECT_ID" -export VERTEXAI_LOCATION="YOUR_LOCATION" +export GOOGLE_GENAI_USE_VERTEXAI=true +export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID" +export GOOGLE_CLOUD_LOCATION="YOUR_LOCATION" ``` Or to add this to your virtual environment: ```bash -echo 'export USE_VERTEXAI=true' >> .venv/bin/activate -echo 'export VERTEXAI_PROJECT="your-project-id"' >> .venv/bin/activate -echo 'export VERTEXAI_LOCATION="your-location"' >> .venv/bin/activate +echo 'export GOOGLE_GENAI_USE_VERTEXAI=true' >> .venv/bin/activate +echo 'export GOOGLE_CLOUD_PROJECT="your-project-id"' >> .venv/bin/activate +echo 'export GOOGLE_CLOUD_LOCATION="your-location"' >> .venv/bin/activate # After editing, you'll need to deactivate and reactivate your virtual # environment if it's already active: deactivate @@ -134,6 +134,9 @@ The `main.py` script is the command-line interface (CLI) for running the browser | Variable | Description | Required | |-|-|-| -| GEMINI_API_KEY | Your API key for the Gemini model. | Yes | -| BROWSERBASE_API_KEY | Your API key for Browserbase. | Yes (when using the browserbase environment) | -| BROWSERBASE_PROJECT_ID | Your Project ID for Browserbase. | Yes (when using the browserbase environment) | +| `GEMINI_API_KEY` | Your API key for the Gemini model. | Yes (if using Gemini Developer API) | +| `GOOGLE_CLOUD_PROJECT` | Your Google Cloud Project. | Yes (if using Vertex AI) | +| `GOOGLE_CLOUD_LOCATION` | Your Google Cloud Region. | Yes (if using Vertex AI) | +| `GOOGLE_GENAI_USE_VERTEXAI` | Set to `True` if using Vertex AI | Yes (if using Vertex AI) | +| `BROWSERBASE_API_KEY` | Your API key for Browserbase. | Yes (when using the browserbase environment) | +| `BROWSERBASE_PROJECT_ID` | Your Project ID for Browserbase. | Yes (when using the browserbase environment) | diff --git a/agent.py b/agent.py index 2df602e..5a9bb3f 100644 --- a/agent.py +++ b/agent.py @@ -75,9 +75,10 @@ def __init__( self.final_reasoning = None self._client = genai.Client( api_key=os.environ.get("GEMINI_API_KEY"), - vertexai=os.environ.get("USE_VERTEXAI", "0").lower() in ["true", "1"], - project=os.environ.get("VERTEXAI_PROJECT"), - location=os.environ.get("VERTEXAI_LOCATION"), + vertexai=os.environ.get("GOOGLE_GENAI_USE_VERTEXAI", "0").lower() + in ["true", "1"], + project=os.environ.get("GOOGLE_CLOUD_PROJECT"), + location=os.environ.get("GOOGLE_CLOUD_LOCATION"), ) self._contents: list[Content] = [ Content(