Skip to content

Commit

Permalink
Minor fixes (#3101)
Browse files Browse the repository at this point in the history
  • Loading branch information
balapv authored Apr 4, 2024
1 parent d4df206 commit f94feec
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 53 deletions.
52 changes: 4 additions & 48 deletions sdk/python/foundation-models/cohere/cohere-cmdR.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {
"name": "imports"
},
Expand Down Expand Up @@ -93,7 +93,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {
"name": "chat_invoke"
},
Expand All @@ -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)"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions sdk/python/foundation-models/cohere/langchain.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"source": [
"chat_model = ChatCohere(\n",
" endpoint=\"https://<endpoint>.<region>.inference.ai.azure.com/v1\",\n",
" mistral_api_key=\"<key>\",\n",
" cohere_api_key=\"<key>\",\n",
")"
]
},
Expand Down Expand Up @@ -210,7 +210,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.10.13"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion sdk/python/foundation-models/cohere/litellm.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
")"
]
Expand Down
4 changes: 2 additions & 2 deletions sdk/python/foundation-models/cohere/openaisdk.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -168,7 +168,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.10.13"
}
},
"nbformat": 4,
Expand Down

0 comments on commit f94feec

Please sign in to comment.