Kaynağa Gözat

Fix/google vertex configs (#4169)

Co-authored-by: GitHub Action <[email protected]>
OpeOginni 3 ay önce
ebeveyn
işleme
bba72c82ae

+ 1 - 1
packages/opencode/src/provider/provider.ts

@@ -193,7 +193,7 @@ export namespace Provider {
     },
     },
     "google-vertex-anthropic": async () => {
     "google-vertex-anthropic": async () => {
       const project = process.env["GOOGLE_CLOUD_PROJECT"] ?? process.env["GCP_PROJECT"] ?? process.env["GCLOUD_PROJECT"]
       const project = process.env["GOOGLE_CLOUD_PROJECT"] ?? process.env["GCP_PROJECT"] ?? process.env["GCLOUD_PROJECT"]
-      const location = process.env["GOOGLE_CLOUD_LOCATION"] ?? process.env["VERTEX_LOCATION"] ?? "us-east5"
+      const location = process.env["GOOGLE_CLOUD_LOCATION"] ?? process.env["VERTEX_LOCATION"] ?? "global"
       const autoload = Boolean(project)
       const autoload = Boolean(project)
       if (!autoload) return { autoload: false }
       if (!autoload) return { autoload: false }
       return {
       return {

+ 10 - 6
packages/web/src/content/docs/providers.mdx

@@ -417,13 +417,13 @@ To use Google Vertex AI with OpenCode:
 1. Head over to the **Model Garden** in the Google Cloud Console and check the
 1. Head over to the **Model Garden** in the Google Cloud Console and check the
    models available in your region.
    models available in your region.
 
 
-   :::tip
+   :::note
    You need to have a Google Cloud project with Vertex AI API enabled.
    You need to have a Google Cloud project with Vertex AI API enabled.
    :::
    :::
 
 
 2. Set the required environment variables:
 2. Set the required environment variables:
-   - `GOOGLE_VERTEX_PROJECT`: Your Google Cloud project ID
-   - `GOOGLE_VERTEX_REGION` (optional): The region for Vertex AI (defaults to `us-east5`)
+   - `GOOGLE_CLOUD_PROJECT`: Your Google Cloud project ID
+   - `VERTEX_LOCATION` (optional): The region for Vertex AI (defaults to `global`)
    - Authentication (choose one):
    - Authentication (choose one):
      - `GOOGLE_APPLICATION_CREDENTIALS`: Path to your service account JSON key file
      - `GOOGLE_APPLICATION_CREDENTIALS`: Path to your service account JSON key file
      - Authenticate using gcloud CLI: `gcloud auth application-default login`
      - Authenticate using gcloud CLI: `gcloud auth application-default login`
@@ -431,17 +431,21 @@ To use Google Vertex AI with OpenCode:
    Set them while running opencode.
    Set them while running opencode.
 
 
    ```bash
    ```bash
-   GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json GOOGLE_VERTEX_PROJECT=your-project-id opencode
+   GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json GOOGLE_CLOUD_PROJECT=your-project-id opencode
    ```
    ```
 
 
    Or add them to your bash profile.
    Or add them to your bash profile.
 
 
    ```bash title="~/.bash_profile"
    ```bash title="~/.bash_profile"
    export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json
    export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json
-   export GOOGLE_VERTEX_PROJECT=your-project-id
-   export GOOGLE_VERTEX_REGION=us-central1
+   export GOOGLE_CLOUD_PROJECT=your-project-id
+   export VERTEX_LOCATION=global
    ```
    ```
 
 
+:::tip
+The `global` region improves availability and reduces errors at no extra cost. Use regional endpoints (e.g., `us-central1`) for data residency requirements. [Learn more](https://cloud.google.com/vertex-ai/generative-ai/docs/partner-models/use-partner-models#regional_and_global_endpoints)
+:::
+
 3. Run the `/models` command to select the model you want.
 3. Run the `/models` command to select the model you want.
 
 
 ---
 ---