View source: R/service-cohere.R
create_chat_cohere | R Documentation |
This function submits a user message to the Cohere Chat API, potentially along with other parameters such as chat history or connectors, and returns the API's response.
create_chat_cohere(
prompt,
chat_history = NULL,
connectors = NULL,
model = "command",
api_key = Sys.getenv("COHERE_API_KEY")
)
prompt |
A string containing the user message. |
chat_history |
A list of previous messages for context, if any. |
connectors |
A list of connector objects, if any. |
model |
A string representing the Cohere model to be used, defaulting to "command". Other options include "command-light", "command-nightly", and "command-light-nightly". |
api_key |
The API key for accessing the Cohere API, defaults to the COHERE_API_KEY environment variable. |
The response from the Cohere Chat API containing the model's reply.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.