From 557ec72bfe9a606d6d600bed609ae0394e641e62 Mon Sep 17 00:00:00 2001 From: Rhys Tyers Date: Wed, 15 Nov 2023 10:24:56 +0000 Subject: [PATCH] Update documentation for Vertex AI --- Usage.md | 17 +++++++++++++++++ pr_agent/settings/.secrets_template.toml | 4 ++++ 2 files changed, 21 insertions(+) diff --git a/Usage.md b/Usage.md index f11b28df..19904fc4 100644 --- a/Usage.md +++ b/Usage.md @@ -303,6 +303,23 @@ key = ... Also review the [AiHandler](pr_agent/algo/ai_handler.py) file for instruction how to set keys for other models. +#### Vertex AI + +To use Google's Vertex AI platform and its associated models (chat-bison/codechat-bison) set: + +``` +[config] # in configuration.toml +model = "vertex_ai/codechat-bison" + +[vertexai] # in .secrets.toml +vertex_project = "my-google-cloud-project" +vertex_location = "" +``` + +Your [application default credentials](https://cloud.google.com/docs/authentication/application-default-credentials) will be used for authentication so there is no need to set explicit credentials in most environments. + +If you do want to set explicit credentials then you can use the `GOOGLE_APPLICATION_CREDENTIALS` environment variable set to a path to a json credentials file. + ### Working with large PRs The default mode of CodiumAI is to have a single call per tool, using GPT-4, which has a token limit of 8000 tokens. diff --git a/pr_agent/settings/.secrets_template.toml b/pr_agent/settings/.secrets_template.toml index b6b11cd4..ba51382c 100644 --- a/pr_agent/settings/.secrets_template.toml +++ b/pr_agent/settings/.secrets_template.toml @@ -36,6 +36,10 @@ api_base = "" # the base url for your huggingface inference endpoint [ollama] api_base = "" # the base url for your local Llama 2, Code Llama, and other models inference endpoint. Acquire through https://ollama.ai/ +[vertexai] +vertex_project = "" # the google cloud platform project name for your vertexai deployment +vertex_location = "" # the google cloud platform location for your vertexai deployment + [github] # ---- Set the following only for deployment type == "user" user_token = "" # A GitHub personal access token with 'repo' scope.