---
title: Ai
summary: Class in @bimworks/jssdk.
order: 10
languages: [javascript]
sdk-package: JavaScript · @bimworks/jssdk
---

# Ai

[[page:reference/javascript/api|API catalogue]] · `@bimworks/jssdk` · Class

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
class Ai
````

Converts natural-language input to BIM.works actions.

## Members

| Member | Kind | Description |
|---|---|---|
| [[page:reference/javascript/bimworks-jssdk/ai-449c4be5#member-constructor-3e603633dbc8|constructor]] | Method |  |
| [[page:reference/javascript/bimworks-jssdk/ai-449c4be5#member-texttoaction-cdee6b69fb35|textToAction]] | Method | Convert natural language to a BIM.works Action. Nothing runs and nothing is saved. |

## `constructor` {#member-constructor-3e603633dbc8}

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
constructor()
````



## `textToAction` {#member-texttoaction-cdee6b69fb35}

````typescript sdk=js sdk-namespace="@bimworks/jssdk"
public textToAction(text: string, transcription?: string, models?: Iterable<string, any, any>, type?: "QUERY3" | "BVL" | "CHECK3" | "IDS", options?: CallOptions): Promise<TextToActionResult>
````

Convert natural language to a BIM.works Action. Nothing runs and nothing is saved.

### Parameters

| Name | Type | Description |
|---|---|---|
| `text` | `string` | The input text, can be any language |
| `transcription` | `string` | Optional additional transcription, can be useful to supply when the text is actually a translation from an original other language |
| `models` | `Iterable<string, any, any>` | Optional models, when models are supplied part of the information in the models will be sent to the LLM |
| `type` | `"QUERY3" \| "BVL" \| "CHECK3" \| "IDS"` | Optional type that can be supplied to only get results of a certain type |
| `options` | [[page:reference/javascript/bimworks-jssdk/calloptions-de0ee685|CallOptions]] | `ui`: the part of the UI a person asked this from |

### Returns

The action; rejects when AI is off, the AI feature is missing or the model gave no valid action
