Method Setup

Our next step would be to setup methods. Methods basically is constructing how the app is going to handle the user requests.

Depending upon the type of the data source , e.g. Gen AI, Twilio data source, internal content etc., there are different operations that can be carried out.

For instance, with Twilio Data source, the user might be able to make calls, send SMS etc., but with Gen AI data source, the user might be able to get response to queries in chat.

Such different operations are termed as 'Request Types'.

For now, let's construct methods for our 3 different data sources from previous step.

Method: Generative AI

  1. Go to “Methods” tab, select “Generative AI” Data Source and click “Add New Method” as shown below.

  1. For “Methods Input” tab, select the Request type and subsequent details as shown below.

  1. For “Method Output” tab, use the details as shown below

  1. For “Method Result” tab, enter the details as shown below

With this, you've now setup for the Gen AI chat responses.

You might also want to provide more specific information about your business. So, for that purpose let's use the content that you created in the prerequisite session and create a method that reads from that content.

GetBusinessInfo Method

Change the data source to Internal Content in the dropdown and click on Add new Method.

Add following details to create a method.

TabParameterValue

Method Inputs

Method Name

GetBusinessInfo

Request Type

GetJSONContents

Parameters: ContentID

The name of the content that contains your business name

e.g. DemoContent

Method Output

Result Type

ListOfRecords

Record Limit

10

Method Result

Record JsonPath

$.[*]

Valid Result Template

{{Records}}

Record Template

{{Session.StoreDescription}}

Session Attributes

SessionAttributes

Name : StoreDescription, Value: {{Results.StoreDescription}}

SessionAttributes

Name : PhoneNumber, Value: {{Results.PhoneNumber}}

SessionAttributes

PName : Email, Value: {{Results.Email}}

In order to get the value for {{Results.StoreDescription}}, {{Results.PhoneNumber}} and {{Results.Email}}, you need to define them as Managed Results. You can find the StoreDescription, PhoneNumber, Email etc on the JSON Content file you uploaded in the prerequisite section.

To add Managed Results, once the method is created, click on the Action button and Select 'Manage Results'

Put the following details. By doing this, you are reading the info from the content file into these variables for use in the method.

Last updated