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")
)
The response from the Cohere Chat API containing the model's reply.
A string containing the user message.
A list of previous messages for context, if any.
A list of connector objects, if any.
A string representing the Cohere model to be used, defaulting to "command". Other options include "command-light", "command-nightly", and "command-light-nightly".
The API key for accessing the Cohere API, defaults to the COHERE_API_KEY environment variable.