You can use the Retool AI resource to generate chat responses based on the provided instructions and message history. You can provide text directly in the query, reference existing data from elsewhere (e.g., another query), or use data stored in Retool Vectors.
To get started with Chat actions for apps, add a new AI Action query. For workflows, add a new AI Action block.
- Web and mobile apps
Generate a response
Use the Generate chat response action to generate a response using the provided input and message history. The message history must be formatted as an array of objects with the following properties:
When combined with the Chat component and Vectors, this AI Action enables you to build an AI chatbot that can generate responses specific to your needs. Adding a Chat component automatically creates an AI Action query with Generate chat response selected and prefills the input and message history.
- Add a Chat component to the canvas.
- Enable Use Retool Vectors to provide more context to your query, if required.
- Select the AI model to use, (e.g., GPT-4).
- Click Save and then Run to perform the action.
The specified AI model then generates a response based on the previous messages and additional input provided.