From 26fb2a416448e9b7ee8b8077ddc268ad12d9fb7c Mon Sep 17 00:00:00 2001 From: mrT23 Date: Wed, 6 Mar 2024 08:20:08 +0200 Subject: [PATCH] Add support for Anthropic Claude-3 model in configuration and update Usage.md --- Usage.md | 14 ++++++++++++++ pr_agent/algo/__init__.py | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Usage.md b/Usage.md index 343569e0..f0dbb3a9 100644 --- a/Usage.md +++ b/Usage.md @@ -464,6 +464,20 @@ Your [application default credentials](https://cloud.google.com/docs/authenticat 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. +##### Anthropic +To use Anthropic models, set the relevant models in the configuration section of the configuration file: +``` +[config] +model="anthropic/claude-3-opus-20240229" +model_turbo="anthropic/claude-3-opus-20240229" +fallback_models=["anthropic/claude-3-opus-20240229"] +``` + +And also set the api key in the .secrets.toml file: +``` +[anthropic] +KEY = "..." +``` ##### Amazon Bedrock To use Amazon Bedrock and its foundational models, add the below configuration: diff --git a/pr_agent/algo/__init__.py b/pr_agent/algo/__init__.py index 0f647bf4..7c537e3a 100644 --- a/pr_agent/algo/__init__.py +++ b/pr_agent/algo/__init__.py @@ -19,7 +19,8 @@ MAX_TOKENS = { 'vertex_ai/codechat-bison-32k': 32000, 'codechat-bison': 6144, 'codechat-bison-32k': 32000, - 'anthropic.claude-v2': 100000, 'anthropic.claude-instant-v1': 100000, 'anthropic.claude-v1': 100000, + 'anthropic.claude-v2': 100000, + 'anthropic/claude-3-opus-20240229': 100000, }