LLM for Cohere. Requires a Cohere API key from https://dashboard.cohere.com/api-keys.
This class provides functionality to interact with the Cohere API for generating text responses. It extends the BaseLLM class and implements the call method to generate text responses.
Initialize the CohereLLM.
Arguments:
name
(Optional[str]
): The name of the Cohere model to use can also be set via the
COHERE_CHAT_MODEL_NAME environment variable.cohere_api_key
(Optional[str]
): The API key for the Cohere client. Can also be set via the
COHERE_API_KEY environment variable.Call the Cohere client.
Arguments:
messages
(List[Message]
): The messages to pass to the Cohere client.Returns:
str
: The response from the Cohere client.