# Chat Completion

## Method Inputs

| Tab           | Parameter                      | Value                                                                                                                                                                                                                     |
| ------------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Method Inputs | Method Name                    | OpenAIChatCompletionMethod                                                                                                                                                                                                |
|               | Request Type                   | openai-textcompletion                                                                                                                                                                                                     |
|               | Parameters: model              | gpt-3.5-turbo-16k                                                                                                                                                                                                         |
|               | Parameters: temperature        | Controls randomness: Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive. Temperature value range between 0 to 1                          |
|               | Parameters: maxtoken           | The maximum number of tokens to generate. Requests can use up to 2,048 or 4,000 tokens shared between prompt and completion. The exact limit varies by model. (One token is roughly 4 characters for normal English text) |
|               | Parameters: top\_p             | Controls diversity via nucleus sampling: 0.5 means half of all likelihood-weighted options are considered. Top\_p value range between 0 to 1                                                                              |
|               | Parameters: frequency\_penalty | How much to penalize new tokens based on their existing frequency in the text so far.  Decreases the model's likelihood to repeat the same line verbatim. Value range between 0 2.                                        |
|               | Parameters: presence\_penalty  | How much to penalize new tokens based on whether they appear in the text so far. Increases the model's likelihood to talk about new topics. Value range between 0 2.                                                      |
|               | Parameters: systemMessage      | Provides a guardrail for the app                                                                                                                                                                                          |
|               | Parameters: userQuestion       | ask any question                                                                                                                                                                                                          |
|               | Parameters: sessionTime        | Session time in minutes used to maintain conversation history. e.g. 10                                                                                                                                                    |
|               | Parameters: OrganizationID     | {{Context.OrganizationID}}                                                                                                                                                                                                |
|               | Parameters: EmployeeID         | {{Context.EmployeeID}}                                                                                                                                                                                                    |


---

# 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/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.
