# Method Setup

Our next step would be to set up methods. Methods detail how the app is going to handle user requests.&#x20;

Depending upon the type of data source, e.g. Gen AI, Twilio, internal content, etc., different operations can be carried out.&#x20;

For instance, with a Twilio data source, the user might be able to make calls, send SMS, etc., but with a Gen AI data source, the user might be able to get responses to queries in chat.&#x20;

Such different operations are termed 'Request Types'.&#x20;

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

#### Method: Generative AI

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

<figure><img src="/files/pjp2e89LLDfLUkCVRFwj" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/ABpLcaaANK8YOlyvKIMH" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/fGsbYIDndL0yGVbc95a7" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/VnkVj8xsZbkOdSKolifg" alt=""><figcaption></figcaption></figure>

With this, you've now set up for the Gen AI chat responses.&#x20;

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.

<figure><img src="/files/vtmX2FdvP60Mmak8HeWI" alt=""><figcaption></figcaption></figure>

Add following details to create a method.

| Tab                | Parameter             | Value                                                        |
| ------------------ | --------------------- | ------------------------------------------------------------ |
| 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}}                      |

<figure><img src="/files/VBytZWy8xHFjTDN3sYey" alt=""><figcaption></figcaption></figure>

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'

<figure><img src="/files/gichlWiU4ZE95NC4vTUk" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/kb7zLxlk6dDQlwlxKNQ5" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ixhello.com/ixhc/general/ix-hello-studio-mode/steps/method-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
