diff --git a/fern/pages/v2/get-started/quickstart/rag-quickstart.mdx b/fern/pages/v2/get-started/quickstart/rag-quickstart.mdx index 3aa17322d..fbbffc148 100644 --- a/fern/pages/v2/get-started/quickstart/rag-quickstart.mdx +++ b/fern/pages/v2/get-started/quickstart/rag-quickstart.mdx @@ -1,6 +1,6 @@ --- -title: Retrieval Augmented Generation (RAG) -slug: /docs/v2/rag-quickstart +title: Retrieval augmented generation (RAG) - quickstart +slug: v2/docs/rag-quickstart description: "A quickstart guide for performing retrieval augmented generation (RAG) with Cohere's Command models (v2 API)." image: "../../../../assets/images/f1cc130-cohere_meta_image.jpg" diff --git a/fern/pages/v2/get-started/quickstart/reranking-quickstart.mdx b/fern/pages/v2/get-started/quickstart/reranking-quickstart.mdx index 49cdde347..da53a4193 100644 --- a/fern/pages/v2/get-started/quickstart/reranking-quickstart.mdx +++ b/fern/pages/v2/get-started/quickstart/reranking-quickstart.mdx @@ -1,6 +1,6 @@ --- -title: Reranking -slug: /docs/v2/reranking-quickstart +title: Reranking - quickstart +slug: v2/docs/reranking-quickstart description: "A quickstart guide for performing reranking with Cohere's Reranking models (v2 API)." image: "../../../../assets/images/f1cc130-cohere_meta_image.jpg" diff --git a/fern/pages/v2/get-started/quickstart/sem-search-quickstart.mdx b/fern/pages/v2/get-started/quickstart/sem-search-quickstart.mdx index c4251a02a..4fac6e2f0 100644 --- a/fern/pages/v2/get-started/quickstart/sem-search-quickstart.mdx +++ b/fern/pages/v2/get-started/quickstart/sem-search-quickstart.mdx @@ -1,6 +1,6 @@ --- -title: Semantic Search -slug: /docs/v2/sem-search-quickstart +title: Semantic search - quickstart +slug: v2/docs/sem-search-quickstart description: "A quickstart guide for performing text semantic search with Cohere's Embed models (v2 API)." image: "../../../../assets/images/f1cc130-cohere_meta_image.jpg" diff --git a/fern/pages/v2/get-started/quickstart/text-gen-quickstart.mdx b/fern/pages/v2/get-started/quickstart/text-gen-quickstart.mdx index 557cb368e..ab976528f 100644 --- a/fern/pages/v2/get-started/quickstart/text-gen-quickstart.mdx +++ b/fern/pages/v2/get-started/quickstart/text-gen-quickstart.mdx @@ -1,6 +1,6 @@ --- -title: Text Generation -slug: /docs/v2/text-gen-quickstart +title: Text generation - quickstart +slug: v2/docs/text-gen-quickstart description: "A quickstart guide for performing text generation with Cohere's Command models (v2 API)." image: "../../../../assets/images/f1cc130-cohere_meta_image.jpg" diff --git a/fern/pages/v2/get-started/quickstart/tool-use-quickstart.mdx b/fern/pages/v2/get-started/quickstart/tool-use-quickstart.mdx index 85a15e577..054469723 100644 --- a/fern/pages/v2/get-started/quickstart/tool-use-quickstart.mdx +++ b/fern/pages/v2/get-started/quickstart/tool-use-quickstart.mdx @@ -1,6 +1,6 @@ --- -title: Tool Use & Agents -slug: /docs/v2/tool-use-quickstart +title: Tool use & agents - quickstart +slug: v2/docs/tool-use-quickstart description: "A quickstart guide for using tool use and building agents with Cohere's Command models (v2 API)." image: "../../../../assets/images/f1cc130-cohere_meta_image.jpg" diff --git a/fern/pages/v2/tool-use/tool-use-citations.mdx b/fern/pages/v2/tool-use/tool-use-citations.mdx index 2e90b902c..267448a64 100644 --- a/fern/pages/v2/tool-use/tool-use-citations.mdx +++ b/fern/pages/v2/tool-use/tool-use-citations.mdx @@ -30,7 +30,9 @@ First, define the tool and its associated schema. import cohere import json -co = cohere.ClientV2("COHERE_API_KEY") # Get your free API key here: https://dashboard.cohere.com/api-keys +co = cohere.ClientV2( + "COHERE_API_KEY" +) # Get your free API key here: https://dashboard.cohere.com/api-keys ``` @@ -41,8 +43,7 @@ import cohere import json co = cohere.ClientV2( - api_key="", # Leave this blank - base_url="" + api_key="", base_url="" # Leave this blank ) ``` @@ -53,13 +54,14 @@ def get_weather(location): temperature = { "bern": "22°C", "madrid": "24°C", - "brasilia": "28°C" + "brasilia": "28°C", } loc = location.lower() if loc in temperature: return [{"temperature": {loc: temperature[loc]}}] return [{"temperature": {loc: "Unknown"}}] + functions_map = {"get_weather": get_weather} tools = [ @@ -86,12 +88,15 @@ tools = [ Next, run the tool calling and execution steps. ```python PYTHON -messages = [{"role": "user", "content": "What's the weather in Madrid and Brasilia?"}] +messages = [ + { + "role": "user", + "content": "What's the weather in Madrid and Brasilia?", + } +] response = co.chat( - model="command-r-plus-08-2024", - messages=messages, - tools=tools + model="command-r-plus-08-2024", messages=messages, tools=tools ) if response.message.tool_calls: @@ -102,16 +107,25 @@ if response.message.tool_calls: "tool_calls": response.message.tool_calls, } ) - + for tc in response.message.tool_calls: tool_result = functions_map[tc.function.name]( **json.loads(tc.function.arguments) ) tool_content = [] for data in tool_result: - tool_content.append({"type": "document", "document": {"data": json.dumps(data)}}) + tool_content.append( + { + "type": "document", + "document": {"data": json.dumps(data)}, + } + ) messages.append( - {"role": "tool", "tool_call_id": tc.id, "content": tool_content} + { + "role": "tool", + "tool_call_id": tc.id, + "content": tool_content, + } ) ``` @@ -124,9 +138,7 @@ Each citation object contains: ```python PYTHON response = co.chat( - model="command-r-plus-08-2024", - messages=messages, - tools=tools + model="command-r-plus-08-2024", messages=messages, tools=tools ) messages.append( @@ -154,13 +166,11 @@ Each citation object contains the same fields as the [non-streaming scenario](#n ```python PYTHON response = co.chat_stream( - model="command-r-plus-08-2024", - messages=messages, - tools=tools + model="command-r-plus-08-2024", messages=messages, tools=tools ) response_text = "" -citations = [] +citations = [] for chunk in response: if chunk: if chunk.type == "content-delta": @@ -168,10 +178,8 @@ for chunk in response: print(chunk.delta.message.content.text, end="") if chunk.type == "citation-start": citations.append(chunk.delta.message.citations) - -messages.append( - {"role": "assistant", "content": response_text} -) + +messages.append({"role": "assistant", "content": response_text}) for citation in citations: print(citation, "\n") @@ -198,10 +206,15 @@ Here is an example of using custom IDs. To keep it concise, let's start with a p import cohere import json -co = cohere.ClientV2("COHERE_API_KEY") # Get your free API key here: https://dashboard.cohere.com/api-keys +co = cohere.ClientV2( + "COHERE_API_KEY" +) # Get your free API key here: https://dashboard.cohere.com/api-keys messages = [ - {"role": "user", "content": "What's the weather in Madrid and Brasilia?"}, + { + "role": "user", + "content": "What's the weather in Madrid and Brasilia?", + }, { "role": "assistant", "tool_plan": "I will search for the weather in Madrid and Brasilia.", @@ -211,7 +224,7 @@ messages = [ "type": "function", "function": { "name": "get_weather", - "arguments": '{"location":"Madrid"}' + "arguments": '{"location":"Madrid"}', }, }, { @@ -219,7 +232,7 @@ messages = [ "type": "function", "function": { "name": "get_weather", - "arguments": '{"location":"Brasilia"}' + "arguments": '{"location":"Brasilia"}', }, }, ], @@ -232,7 +245,7 @@ messages = [ "type": "document", "document": { "data": '{"temperature": {"madrid": "24°C"}}', - "id" : "1" + "id": "1", }, } ], @@ -245,7 +258,7 @@ messages = [ "type": "document", "document": { "data": '{"temperature": {"brasilia": "28°C"}}', - "id" : "2" + "id": "2", }, } ], @@ -257,9 +270,7 @@ When document IDs are provided, the citation will refer to the documents using t ```python PYTHON response = co.chat( - model="command-r-plus-08-2024", - messages=messages, - tools=tools + model="command-r-plus-08-2024", messages=messages, tools=tools ) print(response.message.content[0].text) @@ -307,17 +318,19 @@ With the `citation_options` mode set to `accurate`, we get the citations after t import cohere import json -co = cohere.ClientV2("COHERE_API_KEY") # Get your free API key here: https://dashboard.cohere.com/api-keys +co = cohere.ClientV2( + "COHERE_API_KEY" +) # Get your free API key here: https://dashboard.cohere.com/api-keys response = co.chat_stream( model="command-r-plus-08-2024", messages=messages, tools=tools, - citation_options={"mode": "accurate"} + citation_options={"mode": "accurate"}, ) response_text = "" -citations = [] +citations = [] for chunk in response: if chunk: if chunk.type == "content-delta": @@ -326,7 +339,7 @@ for chunk in response: if chunk.type == "citation-start": citations.append(chunk.delta.message.citations) -print("\n") +print("\n") for citation in citations: print(citation, "\n") ``` @@ -351,7 +364,7 @@ response = co.chat_stream( model="command-r-plus-08-2024", messages=messages, tools=tools, - citation_options={"mode": "fast"} + citation_options={"mode": "fast"}, ) response_text = "" @@ -361,7 +374,10 @@ for chunk in response: response_text += chunk.delta.message.content.text print(chunk.delta.message.content.text, end="") if chunk.type == "citation-start": - print(f" [{chunk.delta.message.citations.sources[0].id}]", end="") + print( + f" [{chunk.delta.message.citations.sources[0].id}]", + end="", + ) ``` Example response: ```mdx wordWrap diff --git a/fern/pages/v2/tool-use/tool-use-overview.mdx b/fern/pages/v2/tool-use/tool-use-overview.mdx index 6e4a5b8f8..75935d2f7 100644 --- a/fern/pages/v2/tool-use/tool-use-overview.mdx +++ b/fern/pages/v2/tool-use/tool-use-overview.mdx @@ -34,7 +34,9 @@ First, import the Cohere library and create a client. # ! pip install -U cohere import cohere -co = cohere.ClientV2("COHERE_API_KEY") # Get your free API key here: https://dashboard.cohere.com/api-keys +co = cohere.ClientV2( + "COHERE_API_KEY" +) # Get your free API key here: https://dashboard.cohere.com/api-keys ``` @@ -44,8 +46,7 @@ co = cohere.ClientV2("COHERE_API_KEY") # Get your free API key here: https://das import cohere co = cohere.ClientV2( - api_key="", # Leave this blank - base_url="" + api_key="", base_url="" # Leave this blank ) ``` @@ -68,10 +69,11 @@ In this example, we define a `get_weather` function that returns the temperature ```python PYTHON def get_weather(location): - # Implement any logic here + # Implement any logic here return [{"temperature": "20°C"}] # Return a JSON object string, or a list of tool content blocks e.g. [{"url": "abc.com", "text": "..."}, {"url": "xyz.com", "text": "..."}] + functions_map = {"get_weather": get_weather} ``` The Chat endpoint accepts [a string or a list of objects](https://docs.cohere.com/reference/chat#request.body.messages.tool.content) as the tool results. Thus, you should format the return value in this way. The following are some examples. @@ -81,8 +83,10 @@ The Chat endpoint accepts [a string or a list of objects](https://docs.cohere.co weather_search_results = "20°C" # Example: List of objects -weather_search_results = [{"city": "Toronto", "date": "250207", "temperature": "20°C"}, - {"city": "Toronto", "date": "250208", "temperature": "21°C"}] +weather_search_results = [ + {"city": "Toronto", "date": "250207", "temperature": "20°C"}, + {"city": "Toronto", "date": "250208", "temperature": "21°C"}, +] ``` ### Defining the tool schema @@ -157,7 +161,9 @@ The following sections go through the implementation of these steps in detail. In the first step, we get the user's message and append it to the `messages` list with the `role` set to `user`. ```python PYTHON -messages = [{"role": "user", "content": "What's the weather in Toronto?"}] +messages = [ + {"role": "user", "content": "What's the weather in Toronto?"} +] ``` @@ -194,9 +200,7 @@ We then append these to the `messages` list with the `role` set to `assistant`. ```python PYTHON response = co.chat( - model="command-r-plus-08-2024", - messages=messages, - tools=tools + model="command-r-plus-08-2024", messages=messages, tools=tools ) if response.message.tool_calls: @@ -236,7 +240,10 @@ These two options are shown below. ```python PYTHON messages = [ - {"role": "user", "content": "What's the weather in Madrid and Brasilia?"}, + { + "role": "user", + "content": "What's the weather in Madrid and Brasilia?", + }, { "role": "assistant", "tool_plan": "I will search for the weather in Madrid and Brasilia.", @@ -245,14 +252,16 @@ messages = [ id="get_weather_dkf0akqdazjb", type="function", function=ToolCallV2Function( - name="get_weather", arguments='{"location":"Madrid"}' + name="get_weather", + arguments='{"location":"Madrid"}', ), ), ToolCallV2( id="get_weather_gh65bt2tcdy1", type="function", function=ToolCallV2Function( - name="get_weather", arguments='{"location":"Brasilia"}' + name="get_weather", + arguments='{"location":"Brasilia"}', ), ), ], @@ -265,7 +274,10 @@ messages = [ ```python PYTHON messages = [ - {"role": "user", "content": "What's the weather in Madrid and Brasilia?"}, + { + "role": "user", + "content": "What's the weather in Madrid and Brasilia?", + }, { "role": "assistant", "tool_plan": "I will search for the weather in Madrid and Brasilia.", @@ -275,7 +287,7 @@ messages = [ "type": "function", "function": { "name": "get_weather", - "arguments": '{"location":"Madrid"}' + "arguments": '{"location":"Madrid"}', }, }, { @@ -283,7 +295,7 @@ messages = [ "type": "function", "function": { "name": "get_weather", - "arguments": '{"location":"Brasilia"}' + "arguments": '{"location":"Brasilia"}', }, }, ], @@ -328,16 +340,14 @@ if response.message.tool_calls: tool_content.append( { "type": "document", - "document": { - "data": json.dumps(data) - } + "document": {"data": json.dumps(data)}, } ) messages.append( { "role": "tool", "tool_call_id": tc.id, - "content": tool_content + "content": tool_content, } ) ``` @@ -353,9 +363,7 @@ We then append the response to the `messages` list with the `role` set to `assis ```python PYTHON response = co.chat( - model="command-r-plus-08-2024", - messages=messages, - tools=tools + model="command-r-plus-08-2024", messages=messages, tools=tools ) messages.append( diff --git a/fern/pages/v2/tool-use/tool-use-parameter-types.mdx b/fern/pages/v2/tool-use/tool-use-parameter-types.mdx index 34f995b13..f590dcac7 100644 --- a/fern/pages/v2/tool-use/tool-use-parameter-types.mdx +++ b/fern/pages/v2/tool-use/tool-use-parameter-types.mdx @@ -70,7 +70,9 @@ The examples on this page each provide a tool schema and a `message` (the user m # ! pip install -U cohere import cohere -co = cohere.ClientV2("COHERE_API_KEY") # Get your free API key here: https://dashboard.cohere.com/api-keys +co = cohere.ClientV2( + "COHERE_API_KEY" +) # Get your free API key here: https://dashboard.cohere.com/api-keys ``` @@ -80,8 +82,7 @@ co = cohere.ClientV2("COHERE_API_KEY") # Get your free API key here: https://das import cohere co = cohere.ClientV2( - api_key="", # Leave this blank - base_url="" + api_key="", base_url="" # Leave this blank ) ``` @@ -91,7 +92,7 @@ co = cohere.ClientV2( ```python PYTHON response = co.chat( # The model name. Example: command-r-plus-08-2024 - model="MODEL_NAME", + model="MODEL_NAME", # The user message. Optional - you can first add a `system_message` role messages=[ { @@ -104,11 +105,11 @@ response = co.chat( # This guarantees that the output will adhere to the schema strict_tools=True, # Typically, you'll need a low temperature for more deterministic outputs - temperature=0 + temperature=0, ) for tc in response.message.tool_calls: - print(f"{tc.function.name} | Parameters: {tc.function.arguments}") + print(f"{tc.function.name} | Parameters: {tc.function.arguments}") ``` diff --git a/fern/pages/v2/tool-use/tool-use-streaming.mdx b/fern/pages/v2/tool-use/tool-use-streaming.mdx index 118b8448c..84589d34d 100644 --- a/fern/pages/v2/tool-use/tool-use-streaming.mdx +++ b/fern/pages/v2/tool-use/tool-use-streaming.mdx @@ -232,7 +232,9 @@ First, import the Cohere library and create a client. # ! pip install -U cohere import cohere -co = cohere.ClientV2("COHERE_API_KEY") # Get your free API key here: https://dashboard.cohere.com/api-keys +co = cohere.ClientV2( + "COHERE_API_KEY" +) # Get your free API key here: https://dashboard.cohere.com/api-keys ``` @@ -242,8 +244,7 @@ co = cohere.ClientV2("COHERE_API_KEY") # Get your free API key here: https://das import cohere co = cohere.ClientV2( - api_key="", # Leave this blank - base_url="" + api_key="", base_url="" # Leave this blank ) ``` @@ -258,13 +259,14 @@ def get_weather(location): temperature = { "bern": "22°C", "madrid": "24°C", - "brasilia": "28°C" + "brasilia": "28°C", } loc = location.lower() if loc in temperature: return [{"temperature": {loc: temperature[loc]}}] return [{"temperature": {loc: "Unknown"}}] + functions_map = {"get_weather": get_weather} tools = [ @@ -293,12 +295,15 @@ tools = [ Before streaming the response, first run through the tool calling and execution steps. ```python PYTHON -messages = [{"role": "user", "content": "What's the weather in Madrid and Brasilia?"}] +messages = [ + { + "role": "user", + "content": "What's the weather in Madrid and Brasilia?", + } +] response = co.chat( - model="command-r-plus-08-2024", - messages=messages, - tools=tools + model="command-r-plus-08-2024", messages=messages, tools=tools ) if response.message.tool_calls: @@ -322,9 +327,18 @@ if response.message.tool_calls: tool_content = [] for data in tool_result: # Optional: the "document" object can take an "id" field for use in citations, otherwise auto-generated - tool_content.append({"type": "document", "document": {"data": json.dumps(data)}}) + tool_content.append( + { + "type": "document", + "document": {"data": json.dumps(data)}, + } + ) messages.append( - {"role": "tool", "tool_call_id": tc.id, "content": tool_content} + { + "role": "tool", + "tool_call_id": tc.id, + "content": tool_content, + } ) ``` @@ -356,13 +370,11 @@ The events are streamed as `chunk` objects. In the example below, we pick `conte ```python PYTHON response = co.chat_stream( - model="command-r-plus-08-2024", - messages=messages, - tools=tools + model="command-r-plus-08-2024", messages=messages, tools=tools ) response_text = "" -citations = [] +citations = [] for chunk in response: if chunk: if chunk.type == "content-delta": @@ -370,7 +382,7 @@ for chunk in response: print(chunk.delta.message.content.text, end="") if chunk.type == "citation-start": citations.append(chunk.delta.message.citations) - + for citation in citations: print(citation, "\n") ``` diff --git a/fern/pages/v2/tool-use/tool-use-usage-patterns.mdx b/fern/pages/v2/tool-use/tool-use-usage-patterns.mdx index e31b67c57..ae97453a5 100644 --- a/fern/pages/v2/tool-use/tool-use-usage-patterns.mdx +++ b/fern/pages/v2/tool-use/tool-use-usage-patterns.mdx @@ -25,7 +25,9 @@ First, import the Cohere library and create a client. # ! pip install -U cohere import cohere -co = cohere.ClientV2("COHERE_API_KEY") # Get your free API key here: https://dashboard.cohere.com/api-keys +co = cohere.ClientV2( + "COHERE_API_KEY" +) # Get your free API key here: https://dashboard.cohere.com/api-keys ``` @@ -35,8 +37,7 @@ co = cohere.ClientV2("COHERE_API_KEY") # Get your free API key here: https://das import cohere co = cohere.ClientV2( - api_key="", # Leave this blank - base_url="" + api_key="", base_url="" # Leave this blank ) ``` @@ -46,10 +47,11 @@ We'll use the same `get_weather` tool as in the [previous example](https://docs. ```python PYTHON def get_weather(location): - # Implement any logic here + # Implement any logic here return [{"temperature": "20C"}] # Return a list of objects e.g. [{"url": "abc.com", "text": "..."}, {"url": "xyz.com", "text": "..."}] + functions_map = {"get_weather": get_weather} tools = [ @@ -79,12 +81,15 @@ The model can determine that more than one tool call is required, where it will In the example below, the user asks for the weather in Toronto and New York. This requires calling the `get_weather` function twice, one for each location. This is reflected in the model's response, where two parallel tool calls are generated. ```python PYTHON -messages = [{"role": "user", "content": "What's the weather in Toronto and New York?"}] +messages = [ + { + "role": "user", + "content": "What's the weather in Toronto and New York?", + } +] response = co.chat( - model="command-r-plus-08-2024", - messages=messages, - tools=tools + model="command-r-plus-08-2024", messages=messages, tools=tools ) if response.message.tool_calls: @@ -134,9 +139,18 @@ if response.message.tool_calls: tool_content = [] for data in tool_result: # Optional: the "document" object can take an "id" field for use in citations, otherwise auto-generated - tool_content.append({"type": "document", "document": {"data": json.dumps(data)}}) + tool_content.append( + { + "type": "document", + "document": {"data": json.dumps(data)}, + } + ) messages.append( - {"role": "tool", "tool_call_id": tc.id, "content": tool_content} + { + "role": "tool", + "tool_call_id": tc.id, + "content": tool_content, + } ) ``` @@ -172,9 +186,7 @@ In the example below, the user asks for a simple arithmetic question. The model messages = [{"role": "user", "content": "What's 2+2?"}] response = co.chat( - model="command-r-plus-08-2024", - messages=messages, - tools=tools + model="command-r-plus-08-2024", messages=messages, tools=tools ) if response.message.tool_calls: @@ -224,27 +236,29 @@ def get_weather(location): temperature = { "bern": "22°C", "madrid": "24°C", - "brasilia": "28°C" + "brasilia": "28°C", } loc = location.lower() if loc in temperature: return [{"temperature": {loc: temperature[loc]}}] return [{"temperature": {loc: "Unknown"}}] + def get_capital_city(country): capital_city = { "switzerland": "bern", - "spain": "madrid", - "brazil": "brasilia" + "spain": "madrid", + "brazil": "brasilia", } country = country.lower() if country in capital_city: return [{"capital_city": {country: capital_city[country]}}] return [{"capital_city": {country: "Unknown"}}] + functions_map = { "get_capital_city": get_capital_city, - "get_weather": get_weather + "get_weather": get_weather, } ``` @@ -269,7 +283,7 @@ tools = [ }, }, { - "type": "function", + "type": "function", "function": { "name": "get_capital_city", "description": "gets the capital city of a given country", @@ -296,15 +310,17 @@ In this example, the user asks for the temperature in Brazil's capital city. ```python PYTHON # Step 1: Get the user message -messages = [{"role": "user", "content": "What's the temperature in Brazil's capital city?"}] +messages = [ + { + "role": "user", + "content": "What's the temperature in Brazil's capital city?", + } +] # Step 2: Generate tool calls (if any) model = "command-r-plus-08-2024" response = co.chat( - model=model, - messages=messages, - tools=tools, - temperature=0.3 + model=model, messages=messages, tools=tools, temperature=0.3 ) while response.message.tool_calls: @@ -527,7 +543,8 @@ messages = [ id="get_weather_1byjy32y4hvq", type="function", function=ToolCallV2Function( - name="get_weather", arguments='{"location":"Toronto"}' + name="get_weather", + arguments='{"location":"Toronto"}', ), ) ], @@ -536,7 +553,10 @@ messages = [ "role": "tool", "tool_call_id": "get_weather_1byjy32y4hvq", "content": [ - {"type": "document", "document": {"data": '{"temperature": "20C"}'}} + { + "type": "document", + "document": {"data": '{"temperature": "20C"}'}, + } ], }, {"role": "assistant", "content": "It's 20°C in Toronto."}, @@ -548,9 +568,7 @@ Then, in the second turn, when provided with a rather vague follow-up user messa messages.append({"role": "user", "content": "What about London?"}) response = co.chat( - model="command-r-plus-08-2024", - messages=messages, - tools=tools + model="command-r-plus-08-2024", messages=messages, tools=tools ) if response.message.tool_calls: diff --git a/fern/pages/v2/tutorials/cohere-on-azure/azure-ai-rag.mdx b/fern/pages/v2/tutorials/cohere-on-azure/azure-ai-rag.mdx index 9877e2c6d..127db3948 100644 --- a/fern/pages/v2/tutorials/cohere-on-azure/azure-ai-rag.mdx +++ b/fern/pages/v2/tutorials/cohere-on-azure/azure-ai-rag.mdx @@ -1,5 +1,5 @@ --- -title: Retrieval Augmented Generation (RAG) on Azure +title: Retrieval augmented generation (RAG) - Cohere on Azure AI Foundry slug: /v2/docs/cohere-on-azure/azure-ai-rag description: "A guide for performing retrieval augmented generation (RAG) with Cohere's Command models on Azure AI Foundry (API v2)." diff --git a/fern/pages/v2/tutorials/cohere-on-azure/azure-ai-reranking.mdx b/fern/pages/v2/tutorials/cohere-on-azure/azure-ai-reranking.mdx index e7244e376..aed76dbea 100644 --- a/fern/pages/v2/tutorials/cohere-on-azure/azure-ai-reranking.mdx +++ b/fern/pages/v2/tutorials/cohere-on-azure/azure-ai-reranking.mdx @@ -1,5 +1,5 @@ --- -title: Reranking +title: Reranking - Cohere on Azure AI Foundry slug: /v2/docs/cohere-on-azure/azure-ai-reranking description: "A guide for performing reranking with Cohere's Reranking models on Azure AI Foundry (API v2)." diff --git a/fern/pages/v2/tutorials/cohere-on-azure/azure-ai-sem-search.mdx b/fern/pages/v2/tutorials/cohere-on-azure/azure-ai-sem-search.mdx index 6d7530aad..b15532179 100644 --- a/fern/pages/v2/tutorials/cohere-on-azure/azure-ai-sem-search.mdx +++ b/fern/pages/v2/tutorials/cohere-on-azure/azure-ai-sem-search.mdx @@ -1,5 +1,5 @@ --- -title: Semantic Search +title: Semantic search - Cohere on Azure AI Foundry slug: /v2/docs/cohere-on-azure/azure-ai-sem-search description: "A guide for performing text semantic search with Cohere's Embed models on Azure AI Foundry (API v2)." diff --git a/fern/pages/v2/tutorials/cohere-on-azure/azure-ai-text-generation.mdx b/fern/pages/v2/tutorials/cohere-on-azure/azure-ai-text-generation.mdx index d9a05790c..b31901d54 100644 --- a/fern/pages/v2/tutorials/cohere-on-azure/azure-ai-text-generation.mdx +++ b/fern/pages/v2/tutorials/cohere-on-azure/azure-ai-text-generation.mdx @@ -1,5 +1,5 @@ --- -title: Text Generation +title: Text generation - Cohere on Azure AI Foundry slug: v2/docs/cohere-on-azure/azure-ai-text-generation description: "A guide for performing text generation with Cohere's Command models on Azure AI Foundry (API v2)." diff --git a/fern/pages/v2/tutorials/cohere-on-azure/azure-ai-tool-use.mdx b/fern/pages/v2/tutorials/cohere-on-azure/azure-ai-tool-use.mdx index 52a8a7b79..a2b546bf6 100644 --- a/fern/pages/v2/tutorials/cohere-on-azure/azure-ai-tool-use.mdx +++ b/fern/pages/v2/tutorials/cohere-on-azure/azure-ai-tool-use.mdx @@ -1,5 +1,5 @@ --- -title: Tool Use & Agents +title: Tool use & agents - Cohere on Azure AI Foundry slug: /v2/docs/cohere-on-azure/azure-ai-tool-use description: "A guide for using tool use and building agents with Cohere's Command models on Azure AI Foundry (API v2)."