> For the complete documentation index, see [llms.txt](https://doc.xcelsior.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.xcelsior.ai/apireference.md).

# Function List

## XASK

* Answer the given question.

### Parameters:

| Name              | Type   | Description                                                                                                              |
| ----------------- | ------ | ------------------------------------------------------------------------------------------------------------------------ |
| `question`        | string | The question you want to ask, can be a literal string or a ref of string in a cell.                                      |
| `prompt`          | string | The extra prompt you want to interact with LLMs, optional.                                                               |
| `outputRangeType` | string | Answer's output format, in one of \["cell", "list", "table"], optional, default is "cell".                               |
| `cellFormatType`  | string | Answer's data format in cell, in one of \["bool", "int", "float", "str", "date", "json"], optional, default is "string". |

### Returns:

* `answer`: Type: `string`

***

## XASKEASY

* Answer the given question via LLM directly.

### Parameters:

| Name       | Type   | Description                                                                         |
| ---------- | ------ | ----------------------------------------------------------------------------------- |
| `question` | string | The question you want to ask, can be a literal string or a ref of string in a cell. |
| `prompt`   | string | The extra prompt you want to interact with LLMs, optional.                          |

### Returns:

* `answer`: Type: `string`

***

## XCALL

* Calling a user-defined function (alpha)

### Parameters:

| Name             | Type   | Attributes | Description                                                                                                              |
| ---------------- | ------ | ---------- | ------------------------------------------------------------------------------------------------------------------------ |
| `functionName`   | string |            | The function name you want to call, which is defined by `xc_def_func` before.                                            |
| `cellFormatType` | string |            | Answer's data format in cell, in one of \["bool", "int", "float", "str", "date", "json"], optional, default is "string". |
| `params`         | Array  |            | Arguments of the calling function, optional.                                                                             |

### Returns:

* `answer`: Type: `string`

***

## XCLASSIFY

* Classifies a given text into a single category.

### Parameters:

| Name         | Type   | Description                                                                                                         |
| ------------ | ------ | ------------------------------------------------------------------------------------------------------------------- |
| `value`      | string | Input text to classify.                                                                                             |
| `categories` | any    | Comma-separated categories or range of categories to choose from. Only the most relevant category will be returned. |

### Returns:

* The best applicable category. Type: `string`

***

## XDEF

* Define your custom function using a specified prompt.

### Parameters:

| Name           | Type   | Attributes | Description                                                                                                                                                       |
| -------------- | ------ | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `functionName` | string |            | The function name.                                                                                                                                                |
| `prompt`       | string |            | The prompt used by the function to interact with LLMs.                                                                                                            |
| `paramsDef`    | Array  |            | The definition of parameters, optional. Supported type: bool, int, float, str. For example, to define a parameter named "age" of type int, write it as "age:int". |

### Returns:

* `success` or `failed`. Type: `string`

***

## XFETCH

* Find the answer from a specified datasource.

### Parameters:

| Name             | Type   | Description                                                                                                              |
| ---------------- | ------ | ------------------------------------------------------------------------------------------------------------------------ |
| `entity`         | string | such as a stock asset symbol (e.g., "AAPL"), project name, or any other identifiable entity.                             |
| `property`       | string | property name such as revenue (e.g., "2024 Q2 revenue"), introduction, or any other attribute of the entity.             |
| `prompt`         | string | The extra prompt you want to interact with LLMs, optional.                                                               |
| `datasource`     | string | The datasource to extract the answer from, optional. Example: xc://source?search=google, xc://source?search=yahoo        |
| `cellFormatType` | string | Answer's data format in cell, in one of \["bool", "int", "float", "str", "date", "json"], optional, default is "string". |

### Returns:

* `answer`: Type: `string`

***

## XFORMAT

* Formats dates, currencies, addresses, names, etc.

### Parameters:

| Name           | Type   | Description                                                   |
| -------------- | ------ | ------------------------------------------------------------- |
| `input`        | string | Input text to format.                                         |
| `targetFormat` | string | Target format for the input. Examples: "iso", "currency iso". |

### Returns:

* The converted input in a single cell. Type: `string`

***

## XMERGE

* Merge selected two tables into one.

### Parameters:

| Name     | Type  | Description                         |
| -------- | ----- | ----------------------------------- |
| `range1` | range | The first table you want to merge.  |
| `range2` | range | The second table you want to merge. |

### Returns:

* `mergedTable`: Type: `range`

***

## XREAD

* Read the web page content

### Parameters:

| Name   | Type   | Attributes | Default  | Description                   |
| ------ | ------ | ---------- | -------- | ----------------------------- |
| `url`  | string |            |          |                               |
| `mode` | string |            | "simple" | "simple" (default) or "full". |

### Returns:

* the body of the web page: Type: `string`

***

## XSUMMARIZE

* Get insight from the selected range on sheet.

### Parameters:

| Name    | Type  | Description         |
| ------- | ----- | ------------------- |
| `range` | range | Range to summarize. |

### Returns:

* Summary in a single cell. Type: `string`

***

## XTAG

* Applies user-defined tags to text or automatically suggests relevant tags if none are specified.

### Parameters:

| Name    | Type   | Description                                                                                                             |
| ------- | ------ | ----------------------------------------------------------------------------------------------------------------------- |
| `value` | string | Input text to tag.                                                                                                      |
| `tags`  | any    | Comma-separated tags or range of tags applicable, optional. If left empty, it will automatically come up with the tags. |

### Returns:

* The applicable tags as csv in a single cell. Type: `string`

***

## XTRANSLATE

* Translates text from one language into another.

### Parameters:

| Name             | Type   | Description                                                                                        |
| ---------------- | ------ | -------------------------------------------------------------------------------------------------- |
| `text`           | string | Input text to translate.                                                                           |
| `targetLanguage` | string | Language of the output, optional. Examples: "spanish", "chinese", "french". Defaults to "english". |

### Returns:

* The requested translation in a single cell. Type: `string`
