View source: R/service-cohere.R
query_api_cohere | R Documentation |
This function sends a JSON post request to the Cohere Chat API, retries on failure up to three times, and returns the response. The function handles errors by providing a descriptive message and failing gracefully.
query_api_cohere(request_body, api_key = Sys.getenv("COHERE_API_KEY"))
request_body |
A list containing the body of the POST request. |
api_key |
String containing a Cohere API key. Defaults to the COHERE_API_KEY environmental variable if not specified. |
A parsed JSON object as the API response.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.