The execution parameter in the act() function allows you to adjust and fine-tune the AI-Native Interface behavior. You can use this parameter to define:
- Tasks the AI-Native Interface must perform based on user queries
- How the AI-Native Interface must query data corpuses to retrieve information
- How the AI-Native Interface must formulate its responses
To modify the AI-Native Interface's behavior, add the act() function to the dialog script. In the execution parameter, specify the transform that provides instructions on how the AI-Native Interface must act in specific situations.
act({
execution: transforms.act_execute
});Example of use
Assume you are building an AI-Native Interface that provides information on medications. When a user asks about medication usage, the AI-Native Interface should recommend consulting a healthcare professional. To achieve this:
To the dialog script, add data corpuses that provide information about medications:
corpus({ title: `Cleveland Clinic`, urls: [`https://my.clevelandclinic.org/health/treatments/penicillin`], depth: 1, maxPages: 1 }); corpus({ title: `Health Direct`, urls: [`https://www.healthdirect.gov.au/penicillin`], depth: 1, maxPages: 1 });In the Debugging Chat, ask a question about medication usage and check the response.
Under Transforms, create the
act_executetransform with the following instructions:If a user asks about medications, give a general response and advise them to consult a healthcare professional for accurate and safe medical advice.To the dialog script, add the
act()function with theexecutionparameter:act({ execution: transforms.act_execute });
In the Debugging Chat, ask a question about medication usage once again and check the response.