Skip to main content

Chat Action

Learn How to Generate Chat Responses with Digisquares AI

Digisquares AI allows you to generate chat responses based on provided instructions and message history. You can input text directly in the query, reference existing data from elsewhere (e.g., another query), or use data stored in Digisquares Vectors.

Get Started

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

Workflows

Generate a Response

Use the Generate chat response action to create a response using the provided input and message history. The message history must be formatted as an array of objects with the following properties:

  • role: string
  • content: string

When combined with the Chat component and Vectors, this AI Action enables you to build an AI chatbot that generates 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.

Steps to Add a Chat Component

  1. Add a Chat component to the canvas.
  2. Enable Use Digisquares Vectors to provide more context to your query, if required.
  3. Select the AI model to use (e.g., GPT-4).
  4. Click Save and then Run to perform the action.

The specified AI model generates a response based on the previous messages and additional input provided.

Accessing Chat Component Properties

Like all components, you can access Chat component properties using JavaScript. For example, Chat components have a messageHistory property that contains all messages in the chat log. You can reference specific messages using:

{{ chat1.messageHistory[0].content }}