Skip to content

Commit

Permalink
Merge pull request #125 from tryAGI/bot/update-openapi_202412042119
Browse files Browse the repository at this point in the history
feat:No changes made in the pull request.
  • Loading branch information
github-actions[bot] authored Dec 4, 2024
2 parents 1835df3 + 5dfd055 commit 2326c59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libs/Cohere/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ paths:
code: "const { CohereClientV2 } = require('cohere-ai');\n\nconst cohere = new CohereClientV2({});\n\n(async () => {\n const response = await cohere.chat({\n model: 'command-r-plus-08-2024',\n tools: [\n {\n type: 'function',\n function: {\n name: 'query_daily_sales_report',\n description:\n 'Connects to a database to retrieve overall sales volumes and sales information for a given day.',\n parameters: {\n type: 'object',\n properties: {\n day: {\n description: 'Retrieves sales data for this day, formatted as YYYY-MM-DD.',\n type: 'string',\n },\n },\n },\n },\n },\n {\n type: 'function',\n function: {\n name: 'query_product_catalog',\n description:\n 'Connects to a a product catalog with information about all the products being sold, including categories, prices, and stock levels.',\n parameters: {\n type: 'object',\n properties: {\n category: {\n description:\n 'Retrieves product information data for all products in this category.',\n type: 'string',\n },\n },\n },\n },\n },\n ],\n messages: [\n {\n role: 'user',\n content:\n \"Can you provide a sales summary for 29th September 2023, and also give me some details about the products in the 'Electronics' category, for example their prices and stock levels?\",\n },\n ],\n });\n\n console.log(response);\n})();\n"
- sdk: python
name: Tools
code: "import cohere\n\nco = cohere.Client()\n\nresponse = co.chat(\n model=\"command-r-plus-08-2024\",\n tools=[\n cohere.ToolV2(\n type=\"function\",\n function={\n \"name\": \"query_daily_sales_report\",\n \"description\": \"Connects to a database to retrieve overall sales volumes and sales information for a given day.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"day\": {\n \"description\": \"Retrieves sales data for this day, formatted as YYYY-MM-DD.\",\n \"type\": \"string\",\n }\n },\n },\n },\n ),\n cohere.ToolV2(\n type=\"function\",\n function={\n \"name\": \"query_product_catalog\",\n \"description\": \"Connects to a a product catalog with information about all the products being sold, including categories, prices, and stock levels.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"category\": {\n \"description\": \"Retrieves product information data for all products in this category.\",\n \"type\": \"string\",\n }\n },\n },\n },\n ),\n ],\n messages=[\n {\n \"role\": \"user\",\n \"content\": \"Can you provide a sales summary for 29th September 2023, and also give me some details about the products in the 'Electronics' category, for example their prices and stock levels?\",\n }\n ],\n)\n\nprint(response)\n"
code: "import cohere\n\nco = cohere.ClientV2()\n\nresponse = co.chat(\n model=\"command-r-plus-08-2024\",\n tools=[\n cohere.ToolV2(\n type=\"function\",\n function={\n \"name\": \"query_daily_sales_report\",\n \"description\": \"Connects to a database to retrieve overall sales volumes and sales information for a given day.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"day\": {\n \"description\": \"Retrieves sales data for this day, formatted as YYYY-MM-DD.\",\n \"type\": \"string\",\n }\n },\n },\n },\n ),\n cohere.ToolV2(\n type=\"function\",\n function={\n \"name\": \"query_product_catalog\",\n \"description\": \"Connects to a a product catalog with information about all the products being sold, including categories, prices, and stock levels.\",\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"category\": {\n \"description\": \"Retrieves product information data for all products in this category.\",\n \"type\": \"string\",\n }\n },\n },\n },\n ),\n ],\n messages=[\n {\n \"role\": \"user\",\n \"content\": \"Can you provide a sales summary for 29th September 2023, and also give me some details about the products in the 'Electronics' category, for example their prices and stock levels?\",\n }\n ],\n)\n\nprint(response)\n"
- sdk: java
name: Tools
code: "/* (C)2024 */\npackage chatv2post;\n\nimport com.cohere.api.Cohere;\nimport com.cohere.api.resources.v2.requests.V2ChatRequest;\nimport com.cohere.api.types.*;\nimport java.util.List;\nimport java.util.Map;\n\npublic class Tools {\n public static void main(String[] args) {\n Cohere cohere = Cohere.builder().clientName(\"snippet\").build();\n\n ChatResponse response =\n cohere\n .v2()\n .chat(\n V2ChatRequest.builder()\n .model(\"command-r-plus-08-2024\")\n .tools(\n List.of(\n ToolV2.builder()\n .function(\n ToolV2Function.builder()\n .name(\"query_daily_sales_report\")\n .description(\n \"Connects\"\n + \" to a\"\n + \" database\"\n + \" to retrieve\"\n + \" overall\"\n + \" sales\"\n + \" volumes\"\n + \" and sales\"\n + \" information\"\n + \" for a\"\n + \" given\"\n + \" day.\")\n .parameters(\n Map.of(\n \"day\",\n ToolParameterDefinitionsValue.builder()\n .type(\"str\")\n .description(\n \"Retrieves\"\n + \" sales\"\n + \" data\"\n + \" for this\"\n + \" day,\"\n + \" formatted\"\n + \" as YYYY-MM-DD.\")\n .required(true)\n .build()))\n .build())\n .build(),\n ToolV2.builder()\n .function(\n ToolV2Function.builder()\n .name(\"query_product_catalog\")\n .description(\n \"Connects\"\n + \" to a\"\n + \" a product\"\n + \" catalog\"\n + \" with\"\n + \" information\"\n + \" about\"\n + \" all the\"\n + \" products\"\n + \" being\"\n + \" sold,\"\n + \" including\"\n + \" categories,\"\n + \" prices,\"\n + \" and stock\"\n + \" levels.\")\n .parameters(\n Map.of(\n \"category\",\n ToolParameterDefinitionsValue.builder()\n .type(\"str\")\n .description(\n \"Retrieves\"\n + \" product\"\n + \" information\"\n + \" data\"\n + \" for all\"\n + \" products\"\n + \" in this\"\n + \" category.\")\n .required(true)\n .build()))\n .build())\n .build()))\n .build());\n\n System.out.println(response);\n }\n}\n"
Expand Down

0 comments on commit 2326c59

Please sign in to comment.