Text generation - quickstart
Text generation - quickstart
Text generation - quickstart
Cohere’s Command family of LLMs are available via the Chat endpoint. This endpoint enables you to build generative AI applications and facilitates a conversational interface for building chatbots.
This quickstart guide shows you how to perform text generation with the Chat endpoint.
First, install the Cohere Python SDK with the following command.
Next, import the library and create a client.
To perform a basic text generation, call the Chat endpoint by passing the messages parameter containing the user message.
The model parameter definition for private deployments is the same as the Cohere platform, as shown below. Find more details on private deployments usage here.
To maintain the state of a conversation, such as for building chatbots, append a sequence of user and assistant messages to the messages list. You can also include a system message at the start of the list to set the context of the conversation.