From f94feec2e8b7c062cfd550f60c707e2e1c0279cd Mon Sep 17 00:00:00 2001 From: Bala P V <33712765+balapv@users.noreply.github.com> Date: Wed, 3 Apr 2024 19:21:02 -0700 Subject: [PATCH] Minor fixes (#3101) --- .../cohere/cohere-cmdR.ipynb | 52 ++----------------- .../foundation-models/cohere/langchain.ipynb | 4 +- .../foundation-models/cohere/litellm.ipynb | 2 +- .../foundation-models/cohere/openaisdk.ipynb | 4 +- 4 files changed, 9 insertions(+), 53 deletions(-) diff --git a/sdk/python/foundation-models/cohere/cohere-cmdR.ipynb b/sdk/python/foundation-models/cohere/cohere-cmdR.ipynb index f2bb8e55a35..a842f64f73d 100644 --- a/sdk/python/foundation-models/cohere/cohere-cmdR.ipynb +++ b/sdk/python/foundation-models/cohere/cohere-cmdR.ipynb @@ -52,7 +52,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "metadata": { "name": "imports" }, @@ -93,7 +93,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": { "name": "chat_invoke" }, @@ -113,57 +113,13 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "metadata": { "name": "chat_response" }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Claude Monet.\n" - ] - } - ], - "source": [ - "print(chat_response.text)" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "Tools" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": {}, - "outputs": [], - "source": [] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, "outputs": [], "source": [ - "messages = [\n", - " ChatMessage(\n", - " role=\"system\",\n", - " content=\"You are a helpful assistant that help users to find information about traveling, how to get to places and the different transportations options. You care about the environment and you always have that in mind when answering inqueries.\",\n", - " ),\n", - " ChatMessage(\n", - " role=\"user\",\n", - " content=\"When is the next flight from Miami to Seattle?\",\n", - " ),\n", - "]\n", - "\n", - "chat_response = client.chat(\n", - " model=\"azureai\", messages=messages, tools=tools, tool_choice=ToolChoice.auto\n", - ")" + "print(chat_response.text)" ] }, { diff --git a/sdk/python/foundation-models/cohere/langchain.ipynb b/sdk/python/foundation-models/cohere/langchain.ipynb index c899112f73d..6f37d1f612f 100644 --- a/sdk/python/foundation-models/cohere/langchain.ipynb +++ b/sdk/python/foundation-models/cohere/langchain.ipynb @@ -117,7 +117,7 @@ "source": [ "chat_model = ChatCohere(\n", " endpoint=\"https://..inference.ai.azure.com/v1\",\n", - " mistral_api_key=\"\",\n", + " cohere_api_key=\"\",\n", ")" ] }, @@ -210,7 +210,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.8" + "version": "3.10.13" } }, "nbformat": 4, diff --git a/sdk/python/foundation-models/cohere/litellm.ipynb b/sdk/python/foundation-models/cohere/litellm.ipynb index 646b3dc3b72..ad1d189b841 100644 --- a/sdk/python/foundation-models/cohere/litellm.ipynb +++ b/sdk/python/foundation-models/cohere/litellm.ipynb @@ -102,7 +102,7 @@ "source": [ "response = client.chat.completions.create(\n", " messages=[{\"content\": \"Who is the most renowned French painter?\", \"role\": \"user\"}],\n", - " model=\"mistral\",\n", + " model=\"cohere\",\n", " custom_llm_provider=\"custom_openai\",\n", ")" ] diff --git a/sdk/python/foundation-models/cohere/openaisdk.ipynb b/sdk/python/foundation-models/cohere/openaisdk.ipynb index c2033e0d290..20868eea8e9 100644 --- a/sdk/python/foundation-models/cohere/openaisdk.ipynb +++ b/sdk/python/foundation-models/cohere/openaisdk.ipynb @@ -6,7 +6,7 @@ "source": [ "# Use OpenAI SDK with Cohere Command R or Cohere Command R+ in Azure AI and Azure ML\n", "\n", - "Use `openai` SDK to consume Mistral deployments in Azure AI and Azure ML. The Cohere family of models in Azure AI and Azure ML offers an API compatible with the OpenAI Chat Completion API. It allows customers and users to transition seamlessly from OpenAI models to Cohere LLMs. \n", + "Use `openai` SDK to consume Cohere deployments in Azure AI and Azure ML. The Cohere family of models in Azure AI and Azure ML offers an API compatible with the OpenAI Chat Completion API. It allows customers and users to transition seamlessly from OpenAI models to Cohere LLMs. \n", "\n", "The API can be directly used with OpenAI's client libraries or third-party tools, like LangChain or LlamaIndex.\n", "\n", @@ -168,7 +168,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.8" + "version": "3.10.13" } }, "nbformat": 4,