diff --git a/independent-publisher-connectors/Cohere/apiDefinition.swagger.json b/independent-publisher-connectors/Cohere/apiDefinition.swagger.json index 6fd94a70de..9d17496a60 100644 --- a/independent-publisher-connectors/Cohere/apiDefinition.swagger.json +++ b/independent-publisher-connectors/Cohere/apiDefinition.swagger.json @@ -3,12 +3,19 @@ "info": { "title": "Cohere", "description": "Cohere is making natural language processing part of every developer's toolkit. Harness the power of language understanding. Join the developers and businesses who are using Cohere to generate, categorize and organize text at a scale that was previously unimaginable.", - "version": "1.0", + "version": "1.1", "contact": { "name": "Troy Taylor", "url": "https://www.hitachisolutions.com", "email": "ttaylor@hitachisolutions.com" - } + }, + "x-ms-keywords": [ + "Cohere", + "AI", + "LLM", + "chat", + "completion" + ] }, "host": "api.cohere.ai", "basePath": "/", @@ -66,6 +73,7 @@ "summary": "Generate text", "description": "This action generates realistic text conditioned on a given input.", "operationId": "GeneratePost", + "deprecated": true, "parameters": [ { "name": "body", @@ -376,7 +384,7 @@ "title": "Spam" } }, - "title": "labels" + "title": "Labels" } } }, @@ -746,6 +754,7 @@ "summary": "Summarize text", "description": "Generates a summary in English for a given text.", "operationId": "SummarizePost", + "deprecated": true, "parameters": [ { "name": "body", @@ -812,13 +821,535 @@ } ] } + }, + "/v1/chat": { + "post": { + "responses": { + "200": { + "description": "default", + "schema": { + "type": "object", + "properties": { + "text": { + "type": "string", + "description": "The text.", + "title": "Text" + }, + "generation_id": { + "type": "string", + "description": "The generation identifier.", + "title": "Generation ID" + }, + "citations": { + "type": "array", + "items": { + "type": "object", + "properties": { + "start": { + "type": "integer", + "format": "int32", + "description": "The start.", + "title": "Start" + }, + "end": { + "type": "integer", + "format": "int32", + "description": "The end.", + "title": "End" + }, + "text": { + "type": "string", + "description": "The text.", + "title": "Text" + }, + "document_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The document identifiers.", + "title": "Document IDs" + } + } + }, + "title": "Citations" + }, + "documents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The identifier.", + "title": "ID" + }, + "additionalProp": { + "type": "string", + "description": "The additional properties.", + "title": "Additional Properties" + } + } + }, + "title": "Documents" + }, + "is_search_required": { + "type": "boolean", + "description": "Whether is search required.", + "title": "Is Search Required" + }, + "search_queries": { + "type": "array", + "items": { + "type": "object", + "properties": { + "text": { + "type": "string", + "description": "The text.", + "title": "Text" + }, + "generation_id": { + "type": "string", + "description": "The generation identifier.", + "title": "Generation ID" + } + } + }, + "title": "Search Queries" + }, + "search_results": { + "type": "array", + "items": { + "type": "object", + "properties": { + "search_query": { + "type": "object", + "properties": { + "text": { + "type": "string", + "description": "The text.", + "title": "Text" + }, + "generation_id": { + "type": "string", + "description": "The generation identifier.", + "title": "Generation ID" + } + }, + "title": "Search Query" + }, + "connector": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The identifier.", + "title": "ID" + } + }, + "title": "Connector" + }, + "document_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The document identifiers.", + "title": "Document IDs" + }, + "error_message": { + "type": "string", + "description": "The error message.", + "title": "Error Message" + }, + "continue_on_failure": { + "type": "boolean", + "description": "Whether to continue on failure.", + "title": "Continue On Failure" + } + } + }, + "title": "Search Results" + }, + "finish_reason": { + "type": "string", + "description": "The finish reason.", + "title": "Finish Reason" + }, + "tool_calls": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name.", + "title": "Name" + }, + "parameters": { + "type": "object", + "properties": { + "additionalProp": { + "type": "object", + "properties": {}, + "description": "The addition properties object.", + "title": "Additional Properties" + } + }, + "title": "Parameters" + } + } + }, + "title": "Tool Calls" + }, + "chat_history": { + "type": "array", + "items": { + "type": "object", + "properties": { + "role": { + "type": "string", + "description": "The role.", + "title": "Role" + }, + "message": { + "type": "string", + "description": "The message.", + "title": "Message" + } + } + }, + "title": "Chat History" + }, + "meta": { + "type": "object", + "properties": { + "api_version": { + "type": "object", + "properties": { + "version": { + "type": "string", + "description": "The version.", + "title": "Version" + }, + "is_deprecated": { + "type": "boolean", + "description": "Whether is deprecated.", + "title": "Is Deprecated" + }, + "is_experimental": { + "type": "boolean", + "description": "Whether is experimental.", + "title": "Is Experimental" + } + }, + "title": "API Version" + }, + "billed_units": { + "type": "object", + "properties": { + "input_tokens": { + "type": "integer", + "format": "int32", + "description": "The input tokens.", + "title": "Input Tokens" + }, + "output_tokens": { + "type": "integer", + "format": "int32", + "description": "The output tokens.", + "title": "Output Tokens" + }, + "search_units": { + "type": "integer", + "format": "int32", + "description": "The search units.", + "title": "Search Units" + }, + "classifications": { + "type": "integer", + "format": "int32", + "description": "The classifications.", + "title": "Classifications" + } + }, + "title": "Billed Units" + }, + "tokens": { + "type": "object", + "properties": { + "input_tokens": { + "type": "integer", + "format": "int32", + "description": "The input tokens.", + "title": "Input Tokens" + }, + "output_tokens": { + "type": "integer", + "format": "int32", + "description": "The output tokens.", + "title": "Output Tokens" + } + }, + "title": "Tokens" + }, + "warnings": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The warnings.", + "title": "Warnings" + } + }, + "title": "Meta" + } + } + } + } + }, + "summary": "Get chat", + "description": "Generates a text response to a user message.", + "operationId": "ChatPost", + "x-ms-visibility": "important", + "parameters": [ + { + "name": "body", + "in": "body", + "required": false, + "schema": { + "type": "object", + "properties": { + "message": { + "type": "string", + "description": "Text input for the model to respond to.", + "title": "Message", + "x-ms-visibility": "important" + }, + "model": { + "type": "string", + "description": "The name of a compatible Cohere model or the ID of a fine-tuned model.", + "title": "Model", + "default": "command-r-plus" + }, + "preamble": { + "type": "string", + "description": "When specified, the default Cohere preamble will be replaced with the provided one. Preambles are a part of the prompt used to adjust the model's overall behavior and conversation style, and use the SYSTEM role.", + "title": "Preamble" + }, + "chat_history": { + "type": "array", + "items": { + "type": "object", + "properties": { + "role": { + "type": "string", + "description": "The role.", + "title": "Role", + "enum": [ + "CHATBOT", + "SYSTEM", + "USER" + ] + }, + "message": { + "type": "string", + "description": "The previous message.", + "title": "Message" + } + } + }, + "title": "Chat History" + }, + "conversation_id": { + "type": "string", + "description": "An alternative to chat history. Providing a conversation_id creates or resumes a persisted conversation with the specified ID. The ID can be any non empty string.", + "title": "Conversation ID" + }, + "prompt_truncation": { + "type": "string", + "description": "Dictates how the prompt will be constructed.", + "title": "Prompt Truncation", + "enum": [ + "AUTO", + "AUTO_PRESERVE_ORDER", + "OFF" + ] + }, + "connectors": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The identifier of the connector.", + "title": "ID" + }, + "user_access_token": { + "type": "string", + "description": "When specified, this user access token will be passed to the connector in the Authorization header instead of the Cohere generated one.", + "title": "User Access Token" + }, + "continue_on_failure": { + "type": "boolean", + "description": "When true, the request will continue if this connector returned an error.", + "title": "Continue On Failure" + }, + "options": { + "type": "object", + "properties": {}, + "description": "Provides the connector with different settings at request time.", + "title": "Options" + } + } + }, + "title": "Connectors" + }, + "search_queries_only": { + "type": "boolean", + "description": "When true, the response will only contain a list of generated search queries, but no search will take place, and no reply from the model to the user's message will be generated.", + "title": "Search Queries Only" + }, + "documents": { + "type": "array", + "items": { + "type": "object", + "properties": { + "title": { + "type": "string", + "description": "The document title.", + "title": "Title" + }, + "text": { + "type": "string", + "description": "The document text.", + "title": "Text" + } + } + }, + "title": "Documents" + }, + "citation_quality": { + "type": "string", + "description": "Dictates the approach taken to generating citations as part of the RAG flow by allowing the user to specify whether they want accurate results or fast results.", + "title": "Citation Quality", + "enum": [ + "accurate", + "fast" + ] + }, + "temperature": { + "type": "number", + "format": "float", + "description": "A non-negative float that tunes the degree of randomness in generation. Lower temperatures mean less random generations, and higher temperatures mean more random generations.", + "title": "Temperature" + }, + "max_tokens": { + "type": "integer", + "format": "int32", + "description": "The maximum number of tokens the model will generate as part of the response. Note: Setting a low value may result in incomplete generations.", + "title": "Max Tokens" + }, + "max_input_tokens": { + "type": "integer", + "format": "int32", + "description": "The maximum number of input tokens to send to the model. If not specified, max_input_tokens is the model's context length limit minus a small buffer.", + "title": "Max Input Tokens" + }, + "k": { + "type": "integer", + "format": "int32", + "description": "Ensures only the top k most likely tokens are considered for generation at each step. Defaults to 0, min value of 0, max value of 500.", + "title": "k", + "minimum": 0, + "maximum": 500 + }, + "p": { + "type": "number", + "format": "float", + "description": "Ensures that only the most likely tokens, with total probability mass of p, are considered for generation at each step. If both k and p are enabled, p acts after k. Defaults to 0.75. min value of 0.01, max value of 0.99.", + "title": "p", + "minimum": 0.01, + "maximum": 0.99 + }, + "seed": { + "type": "number", + "format": "float", + "description": "If specified, the backend will make a best effort to sample tokens deterministically, such that repeated requests with the same seed and parameters should return the same result. However, determinism cannot be totally guaranteed.", + "title": "Seed" + }, + "stop_sequences": { + "type": "array", + "items": { + "type": "string" + }, + "description": "A list of up to 5 strings that the model will use to stop generation. If the model generates a string that matches any of the strings in the list, it will stop generating tokens and return the generated text up to that point not including the stop sequence.", + "title": "Stop Sequences" + }, + "frequency_penalty": { + "type": "number", + "format": "float", + "description": "Used to reduce repetitiveness of generated tokens. The higher the value, the stronger a penalty is applied to previously present tokens, proportional to how many times they have already appeared in the prompt or prior generation.", + "title": "Frequency Penalty", + "minimum": 0.0, + "maximum": 1.0 + }, + "presence_penalty": { + "type": "number", + "format": "float", + "description": "Used to reduce repetitiveness of generated tokens. Similar to frequency_penalty, except that this penalty is applied equally to all tokens that have already appeared, regardless of their exact frequencies.", + "title": "Presence Penalty" + }, + "tools": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the tool to be called. Valid names contain only the characters a-z, A-Z, 0-9, _ and must not begin with a digit.", + "title": "Name" + }, + "description": { + "type": "string", + "description": "The description of what the tool does, the model uses the description to choose when and how to call the function.", + "title": "Description" + }, + "parameter_definitions": { + "type": "object", + "properties": {}, + "description": "The input parameters of the tool.", + "title": "Parameter Definitions" + } + } + }, + "title": "Tools" + } + }, + "required": [ + "message" + ] + } + } + ], + "x-ms-openai-data": { + "openai-enabled": true, + "operations": [ + { + "operationId": "ChatPost", + "x-ms-require-user-confirmation": true + } + ] + } + } } }, "definitions": {}, "parameters": {}, "responses": {}, "securityDefinitions": { - "API Key": { + "API Key in the form 'Bearer API_Key'": { "type": "apiKey", "in": "header", "name": "Authorization" @@ -826,7 +1357,7 @@ }, "security": [ { - "API Key": [] + "API Key in the form 'Bearer API_Key'": [] } ], "tags": [], @@ -843,5 +1374,10 @@ "propertyName": "Categories", "propertyValue": "AI" } - ] -} + ], + "x-ms-openai-manifest": { + "humanName": "Cohere", + "modelDescription": "This is a Copilot plugin for the Cohere AI service.", + "contactEmail": "ttaylor@hitachisolutions.com" + } +} \ No newline at end of file diff --git a/independent-publisher-connectors/Cohere/readme.md b/independent-publisher-connectors/Cohere/readme.md index dc4dbd0124..310cb99c3c 100644 --- a/independent-publisher-connectors/Cohere/readme.md +++ b/independent-publisher-connectors/Cohere/readme.md @@ -24,6 +24,8 @@ Converts tokens using byte-pair encoding and returns their text representation. Detects which language each of the provided texts is written in. ### Summarize text Generates a summary in English for a given text. +### Get chat +Generates a text response to a user message. ## Known Issues and Limitations There are no known issues at this time.