Skip to main content

PluginOptions

Properties

expert?

optional expert: object

Expert settings

debounceTime?

optional debounceTime: number

Debounce time in ms. Default is 300. Time after user stopped typing before request will be sent.

maxTokens?

optional maxTokens: number

Number of tokens to generate. Default is 50. 1 token ~= ¾ words

promptInputLimit?

optional promptInputLimit: number

Maximum number of last characters which will be used for completion for target field. Default is 500. Higher value will give better context but will cost more.

recordContext?

optional recordContext: object

When completion is made, this plugin passes non-empty fields of the record to the LLM model for record context understanding.

recordContext.maxFieldLength?

optional maxFieldLength: number

Limit of input field value. Default is 300. If field is longer, it will be truncated.

recordContext.maxFields?

optional maxFields: number

Using this field you can limit number of fields passed to the model. Default is 5. Completion field is not included in this limit. Set to 0 to disable context passing at all. If count of fields exceeds this number, longest fields will be selected. If some of values will exceed maxFieldLength, it will be smartly truncated by splitting ito splitParts, taking their starting substring and joining back with '...'.

recordContext.splitParts?

optional splitParts: number

How many parts to split field value if it exceeds maxFieldLength. Default is 5.

stop?

optional stop: string[]

Stop tokens. Default is ['.']

temperature?

optional temperature: number

Temperature (0-1). Lower is more deterministic, higher is more unpredicted creative. Default is 0.7.


fieldName

fieldName: string

Field where plugin will auto-complete text. Should be string or text field.


model?

optional model: string

Model name. Go to https://platform.openai.com/docs/models, select model and copy name. Default is gpt-4o-mini. Use e.g. more expensive gpt-4o for more powerful model.


openAiApiKey

openAiApiKey: string

OpenAI API key. Go to https://platform.openai.com/, go to Dashboard -> API keys -> Create new secret key Paste value in your .env file OPENAI_API_KEY=your_key Set openAiApiKey: process.env.OPENAI_API_KEY to access it


rateLimit?

optional rateLimit: object

Since AI generation can be expensive, we can limit the number of requests per IP. Completion will simply stop working when limit is reached so user will not be bothered with error messages.

errorMessage

errorMessage: string

Message shown to user when rate limit is reached

limit

limit: string

E.g. 5/1d - 5 requests per day 3/1h - 3 requests per hour