Using Domain Assistant
The Data² Domain Assistant is a virtual assistant designed to help complete tasks and answer questions quickly and efficiently. It is made to make using the Data² platform easier by providing support features and guidance to users, among other uses.
How to Create a Domain Assistant
Double-click on the screen in your Workspace, select Domain, and click on Virtual Assistant.
The Domain Assistant will be created and ready to receive your questions or commands.
Getting Answers and Information
The Domain Assistant will process your question and provide a relevant answer or information. The answers can be in text form, JSON, external links, or even code snippets. If the answer is unclear or you need more information, you can ask additional questions or request clarification.
Try different questions and commands to explore the range of resources and information it can provide. It can understand natural language questions. Type your question or command in Test
and press Send
.
Example:
Setup
The Assistant has configurable properties in its setup to allow for personalized adjustments and performance optimization. By providing configurable parameters, you have the flexibility to adapt the AI environment to your specific needs and preferences. The ability to configure properties also offers the opportunity to experiment with different settings and find the ideal combination for each application or problem. You can edit them directly in the Assistant:
Or through the Builder's Inspector:
Content
In the context of the virtual assistant setup, the content
field refers to the content that will be displayed or processed by the virtual assistant. This field can include information such as predefined responses, dialogue scripts, action commands for the assistant to execute.
Behavior
The behavior
field refers to the actions or behavior the assistant should perform in response to different commands or events. This field allows you to define how the assistant should interact with users and respond to various situations. For example, you can set the assistant's behavior to answer frequently asked questions, provide information about products or services, conduct transactions, schedule appointments, and more. You are giving instructions on how it should behave in different scenarios to provide relevant and helpful responses.
Premises
The premises
field refers to the assumptions the virtual assistant makes when interpreting user questions or commands. These premises can include information such as the conversation context, user profile data, previously provided information, and more.
Answer Prefix
The answer prefix
field is a text placed before the Assistant's response to influence the answer. For example, in a Domain Assistant set up in English, if you put "Ok, generating your response in Brazilian Portuguese:" in the answer prefix
, the Assistant will generate the response in Portuguese because it understands that it should respond in Portuguese.
In a chat where we send system messages, user messages, and Assistant messages, the fields of the Assistant, the user's prompt, and the Assistant's response would fit together like this:
System: [context, behavior, premises]
Human: [Prompt]
Assistant: [answer prefix] [answer]
Example
Let's create a page that creates a travel itinerary based on the destination and information the user provides. For this project, we need an Assistant to create the itinerary and an Artboard to place the fields the user needs to fill out and the result that will be displayed on the screen.
First, we will create the Assistant named Itinerary Generator
, which will receive the destination and create the complete itinerary. In this step, be very detailed and explicit with the desired behavior.
Next, we will create an Artboard
to perform the necessary interactions. Add a Block
as the Label, set the text to Destination
, and a DataFieldBlock
linked to a UIState
(in the image, objective
).
In the onClick
of the Block
used as a button, set the Module
to the Assistant Itinerary Generator
and in the Interaction
select consult
. As the Prompt, you should pass a Getter
from the UIState
defined in the previous step, in this case, the UIState
called objective
.
To display the generated itinerary, we can create a Block
and in Text
use a Getter
, setting the Module
to Prompt Generator
and passing currentAnswer
as Prop
. This way, it will return the Assistant's last response.
To test the application, we can run the Artboard and type in the prompt some information about the travel period, duration, and destination.
The result should look similar to the following image: