# Text autocomplete

### Overview <a href="#autocompletesuggestions-overview" id="autocompletesuggestions-overview"></a>

**Text autocomplete suggestions** was rolled out as a part of the WebSpellChecker[ v5.19.0 release](https://webspellchecker.com/release-notes/v5-19-0/). The feature automatically completes the user’s thought by suggesting the next word or a short phrase based on the context.

The functionality is implemented and added to WProofreader-based products (on-premises and cloud versions) in the **turned OFF state**. In the [WProofreader browser extension](https://wproofreader.com/), the feature is enabled by default.

Autocomplete suggestions while typing are available only for English dialects (en\_AU, en\_CA, en\_GB, en\_NZ, en\_US, en\_ZA) for now.

Developers can update the configuration and turn ON the autocomplete by default for all users. Also, there is a toggle setting on the UI allowing end-users to enable or disable text prediction.

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

### Autocomplete mechanism <a href="#autocompletesuggestions-autocompletemechanism" id="autocompletesuggestions-autocompletemechanism"></a>

Autocomplete is based on the GPT2 (small) model pre-trained on a very large corpus of English data.

The autocomplete suggests the next word or a short phrase based on the context. For example, if the user writes “thank”, the autocomplete suggests “you”. Autocomplete suggestions are **highlighted in gray**. To accept the suggestion, the user clicks the right arrow key **→** or **Tab**. To ignore/refuse the suggestion, the user should continue writing. To “undo” the autocomplete suggestion, the user should use the native revert mechanism of the browser or editor (for instance, click Ctrl+Z).

The functionality is disabled for **input** fields and **tables** due to the lack of space to show autocomplete suggestions. The feature works in **textareas** if the cursor is at the end of the text.

The user is typing a space, and after **0ms**, the request for the autocomplete command is sent. If the text is smaller or equals 200 characters, then the request includes the whole text. If the text is larger than 200 characters, then the autocomplete request includes only the last 200 characters. If the text is too large, it will be limited to 64 tokens on the server/network side.

#### Configuration <a href="#autocompletesuggestions-configuration" id="autocompletesuggestions-configuration"></a>

Admins can enable autocomplete by adding **autocomplete: true**, option to WEBSPELLCHECKER\_CONFIG. End users will still have an option to disable autocomplete suggestions from the UI of the Settings dialog.

```javascript
<script>
    window.WEBSPELLCHECKER_CONFIG = {
        ...
        autocomplete: true,
        ...
    }
</script>
```

Admins can hide the autocomplete section from the settings, so users can’t enable or disable this feature by removing the '**general'** value from the **settingsSections** option. Please note that in this case the option to enable/disable **Spelling autocorrect** won’t be available either.

```javascript
<script>
    window.WEBSPELLCHECKER_CONFIG = {
        ...
   		settingsSections: ['dictionaries', 'languages', 'general', 'options'],
        ...
    }
</script>
```

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

This option and all other options for WProofreader are available in the [WProofreader API options](https://webspellchecker.com/docs/api/wscbundle/Options.html).\ <br>


---

# 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.wproofreader.com/features/text-autocomplete.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.
