# Chat Completion

## Method Inputs

| Tab          | Parameter                  | Value                                                                  |
| ------------ | -------------------------- | ---------------------------------------------------------------------- |
| Method Input | Method Name                | AzureChatCompletionMethod                                              |
|              | Request Type               | azure-openai-chatcompletion                                            |
|              | Parameters: SystemMessage  | {{Sesssion.StoreDescription}}, {{App.AIContent.SystemMessage}}         |
|              | Parameters: UserQuestion   | {{UserInput}}                                                          |
|              | Parameters: Streaming      | False                                                                  |
|              | Parameters: SessionTime    | Session time in minutes used to maintain conversation history. e.g. 10 |
|              | Parameters: OrganizationID | {{Context.OrganizationID}}                                             |
|              | Parameters: EmployeeID     | {{Context.EmployeeID}}                                                 |

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

## Method Output

You can get the result of the query as a single record or you can get a list of records. You can also define the number of items in the list using Record Limit Parameter.

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

## Method Result

The method result section is used to define how you want to display the result of the query response.&#x20;

| Tab           | Parameter                              | Value                                |
| ------------- | -------------------------------------- | ------------------------------------ |
| Method Result | Record JsonPath                        | $.choices\[0].message                |
|               | Valid Result Template                  | {{Records}} How else can I help you? |
|               | Record Template                        | {{content}}                          |
|               | Empty Result Template                  | How else can I help you?             |
|               | Automatically prompt for next question | False                                |

a. Record JsonPath: The result of each method is returned in JSON and ixHello uses[ JSONPath query ](https://jsonpath.com/)to access those results. By providing the value $.choices\[0].message, you are asking the method to read the message of first item in the list of results. The response JSON looks somewhat like this.

b. Valid Result Template: It defines how the result is presented to the user.&#x20;

By using {{Records}} , you are accessing all the results of the method query.&#x20;

c. Record Template : This represents a single record and how a record shall be presented to the user. {{content}}

d. Empty Result Template : In case the query does not return any value, this prompt is next displayed to the user.

e. Automatically prompt for next question: This flag is intended for integrations to smart bots like Alexa and Lex, where the user defines if the bot shall prompt the user for next question after the previous query has been answered for the app. For Generative AI apps, this flag is set to false.

<mark style="color:red;">Note:</mark> Everything parameter that has{{ }} means that the platform is interpreting the value from its parameters, input parameters or managed results.

<figure><img src="/files/yWrQmDCRYavuB0kEkCBY" 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/edit-custom-apps/methods/data-source-generative-ai/azure-open-ai/chat-completion.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.
