# BF Utility Functions

{% hint style="info" %}
Requires version 0.9.20 or later
{% endhint %}

### Errors

| Function                                         |                                                                                                                                                                                                                                                                                                                                                                                 |
| ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Actions**                                      |                                                                                                                                                                                                                                                                                                                                                                                 |
| BF.actionsClear()                                | Clears the action script buffer halting all subsequent actions ( current action completes)                                                                                                                                                                                                                                                                                      |
|                                                  |                                                                                                                                                                                                                                                                                                                                                                                 |
| **Errors**                                       |                                                                                                                                                                                                                                                                                                                                                                                 |
| BF.errorClearAll()                               | Clears the error cache                                                                                                                                                                                                                                                                                                                                                          |
| BF.errorThrow(errorCode, errorDescription, info) | Creates an error                                                                                                                                                                                                                                                                                                                                                                |
| BF.namedAction(name, options)                    | Runs a named action, options are propagated to all actions within the named action.                                                                                                                                                                                                                                                                                             |
| BF.rebuildReactivity(object)                     | <p>This function is normally run upon a completion of a <code>function</code> .<br>It recursively scans the object passed, and adds new reactive keys to keys that do are new or do not have reactivity. You will not need to use this within a function unless that function has a callback that later mutates a reactive object. Eg: setTimeout() which takes a callback.</p> |
|                                                  |                                                                                                                                                                                                                                                                                                                                                                                 |
| **Misc**                                         |                                                                                                                                                                                                                                                                                                                                                                                 |
| BF.socketConnect()                               | Connects the client to the BF server via a socket                                                                                                                                                                                                                                                                                                                               |
| BF.socketDisconnect()                            | <p>Disconnects the client from the BF servers<br>( Goes off line)</p>                                                                                                                                                                                                                                                                                                           |
| BF.getUUID()                                     | Returns a UUID                                                                                                                                                                                                                                                                                                                                                                  |
| BF.getQueryParam(key)                            | Returns the URL query key value                                                                                                                                                                                                                                                                                                                                                 |


---

# 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.klai.studio/v1/reference/bf-utility-function-ver-0.9.20+.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.
