From bc39447bb194ee7c6f587a708a29716083d1b16e Mon Sep 17 00:00:00 2001 From: Sanjiv Das Date: Thu, 20 Jun 2024 13:43:29 -0700 Subject: [PATCH] Add claude sonnet 3.5 models (#847) * Update `/clear' to use `Handler` Builds the message in the help handler and then uses it after clearing chat. * Add claude-3.5-sonnet Anthropic's latest model, released 20th June 2024, added. * Add claude3.5 sonnet * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * reverting clear changes * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update anthropic.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .../jupyter_ai_magics/partner_providers/anthropic.py | 3 ++- packages/jupyter-ai-magics/jupyter_ai_magics/providers.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/jupyter-ai-magics/jupyter_ai_magics/partner_providers/anthropic.py b/packages/jupyter-ai-magics/jupyter_ai_magics/partner_providers/anthropic.py index a428b9310..7876c2850 100644 --- a/packages/jupyter-ai-magics/jupyter_ai_magics/partner_providers/anthropic.py +++ b/packages/jupyter-ai-magics/jupyter_ai_magics/partner_providers/anthropic.py @@ -38,7 +38,7 @@ def is_api_key_exc(cls, e: Exception): class ChatAnthropicProvider( BaseProvider, ChatAnthropic -): # https://docs.anthropic.com/claude/docs/models-overview +): # https://docs.anthropic.com/en/docs/about-claude/models id = "anthropic-chat" name = "ChatAnthropic" models = [ @@ -48,6 +48,7 @@ class ChatAnthropicProvider( "claude-3-opus-20240229", "claude-3-sonnet-20240229", "claude-3-haiku-20240307", + "claude-3-5-sonnet-20240620", ] model_id_key = "model" pypi_package_deps = ["anthropic"] diff --git a/packages/jupyter-ai-magics/jupyter_ai_magics/providers.py b/packages/jupyter-ai-magics/jupyter_ai_magics/providers.py index 097b3ef3e..4cd39650b 100644 --- a/packages/jupyter-ai-magics/jupyter_ai_magics/providers.py +++ b/packages/jupyter-ai-magics/jupyter_ai_magics/providers.py @@ -849,6 +849,7 @@ class BedrockChatProvider(BaseProvider, BedrockChat): "anthropic.claude-3-sonnet-20240229-v1:0", "anthropic.claude-3-haiku-20240307-v1:0", "anthropic.claude-3-opus-20240229-v1:0", + "anthropic.claude-3-5-sonnet-20240620-v1:0", ] model_id_key = "model_id" pypi_package_deps = ["boto3"]