langchain_community.chat_models.cohere.ChatCohere¶
class langchain_community.chat_models.cohere.ChatCohere[source]¶
Bases: BaseChatModel, BaseCohere
Cohere chat large language models.
To use, you should have the cohere python package installed, and the
environment variable COHERE_API_KEY set with your API key, or pass
it as a named parameter to the constructor.
Example
from langchain_community.chat_models import ChatCohere
from langchain_core.messages import HumanMessage
chat = ChatCohere(model="foo")
result = chat([HumanMessage(content="Hello")])
print(result.content)
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
param cache: Optional[bool] = None¶
Whether to cache the response.
param callback_manager: Optional[BaseCallbackManager] = None¶
Callback manager to add to the run trace.
param callbacks: Callbacks = None¶
Callbacks to add to the run trace.
param cohere_api_key: Optional[str] = None¶
param metadata: Optional[Dict[str, Any]] = None¶
Metadata to add to the run trace.
param model: Optional[str] = None¶
Model name to use.
param stop: Optional[List[str]] = None¶
param streaming: bool = False¶
Whether to stream the results.
param tags: Optional[List[str]] = None¶
Tags to add to the run trace.
param temperature: float = 0.75¶
A non-negative float that tunes the degree of randomness in generation.
param user_agent: str = 'langchain'¶
Identifier for the application making the request.
param verbose: bool [Optional]¶
Whether to print out response text.