Retool AI chat actions
Learn how to generate chat responses with Retool AI.
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.
Get started
To get started with chat actions for apps, add a new LLM Chat component. For workflows, add a new AI Action block.
- Web and mobile apps
- Workflows
Adding a LLM Chat component automatically creates an AI Action query with Generate chat response selected and prefills the input and message history.
- Add an LLM Chat component to the canvas.
- Find the newly-created Retool AI query.
- Optionally, enable Use Retool Vectors to provide more context to your query, and choose the vector you want to use. Incorporating Vectors enables the chatbot to generate responses specific to your needs.
- 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.
Like all components, you can access LLM Chat component properties using JavaScript. For example, LLM Chat components have a messageHistory
property that contains all messages in the chat log. You can reference specific messages using {{ chat1.messageHistory[0].content }}
.
Refer to the LLM Chat guide for more information about this component.
- Click and drag to create a new, connected block.
- Select AI Action.
- Optionally, enable Use Retool Vectors to provide more context to your query, and choose the vector you want to use. Incorporating Vectors enables the chatbot to generate responses specific to your needs.
- Select the AI model to use (e.g., GPT-4).