From 131a1584a5fc7f5cf31ef8c60c6a3f8416f26caf Mon Sep 17 00:00:00 2001 From: Sanjiv Das Date: Fri, 14 Jun 2024 12:04:51 -0700 Subject: [PATCH 1/2] Add new Cohere models Added `command-r` and `command-r-plus` models --- packages/jupyter-ai-magics/jupyter_ai_magics/providers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/jupyter-ai-magics/jupyter_ai_magics/providers.py b/packages/jupyter-ai-magics/jupyter_ai_magics/providers.py index e24f53e56..c6e9835e9 100644 --- a/packages/jupyter-ai-magics/jupyter_ai_magics/providers.py +++ b/packages/jupyter-ai-magics/jupyter_ai_magics/providers.py @@ -549,8 +549,8 @@ def is_api_key_exc(cls, e: Exception): class CohereProvider(BaseProvider, Cohere): id = "cohere" name = "Cohere" - # Source: https://docs.cohere.com/reference/generate - models = ["command", "command-nightly", "command-light", "command-light-nightly"] + # Source: https://docs.cohere.com/reference/generate; https://docs.cohere.com/docs/models + models = ["command", "command-nightly", "command-light", "command-light-nightly", "command-r-plus", "command-r"] model_id_key = "model" pypi_package_deps = ["cohere"] auth_strategy = EnvAuthStrategy(name="COHERE_API_KEY") From 6b06a4a0a59dc81cad698e6bdc290d8c82951a33 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 14 Jun 2024 19:09:36 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../jupyter-ai-magics/jupyter_ai_magics/providers.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/jupyter-ai-magics/jupyter_ai_magics/providers.py b/packages/jupyter-ai-magics/jupyter_ai_magics/providers.py index c6e9835e9..8a04efd47 100644 --- a/packages/jupyter-ai-magics/jupyter_ai_magics/providers.py +++ b/packages/jupyter-ai-magics/jupyter_ai_magics/providers.py @@ -550,7 +550,14 @@ class CohereProvider(BaseProvider, Cohere): id = "cohere" name = "Cohere" # Source: https://docs.cohere.com/reference/generate; https://docs.cohere.com/docs/models - models = ["command", "command-nightly", "command-light", "command-light-nightly", "command-r-plus", "command-r"] + models = [ + "command", + "command-nightly", + "command-light", + "command-light-nightly", + "command-r-plus", + "command-r", + ] model_id_key = "model" pypi_package_deps = ["cohere"] auth_strategy = EnvAuthStrategy(name="COHERE_API_KEY")