TextGenerator¶
Gives access to a large language model for text generation.
Not implemented yet
This class exists in the current Roblox API but is not implemented in Nova yet. Scripts that reference it will fail at runtime.
Description¶
A TextGenerator instance lets you use a large language model (LLM) to
generate text based on a system prompt from you and a user prompt from the
player. The most common use of the API is for creating interactive non-player
characters (NPCs).
For example, in a survival experience, your system prompt for a talking animal
might be
"You are a very busy beaver. You end all statements by mentioning how you need to get back to work on your dam.".
Users could ask the beaver about water in the area, the size of a nearby
forest, predators, etc.
The novelty of LLM responses can help create unique, delightful moments for players, but using the API effectively requires a bit of creativity and tuning. System prompts can be very extensive, so don't hesitate to include a long string with lots of detail.
Rate limits¶
Requests are initially limited to 100 per minute, which scales up based on the number of concurrent users.
Inheritance¶
Object โ Instance โ TextGenerator
Properties¶
| Member | Signature | Summary |
|---|---|---|
Seed |
Seed: int |
Sets a fixed seed for the random number generator, allowing reproducible responses in cases where the same input parameters are used across multiple requests. |
SystemPrompt |
SystemPrompt: string |
Provides context to the model about its role, tone, or behavior during conversation. |
Temperature |
Temperature: float |
Controls the "creativity" or randomness of the model's responses. |
TopP |
TopP: float |
Helps the AI model narrow or expand the range of possible words to sample from while generating the next token. |
Methods¶
| Member | Signature | Summary |
|---|---|---|
GenerateTextAsync |
TextGenerator:GenerateTextAsync(request: Dictionary): Dictionary |
Returns text generated by an LLM based on the provided system and user prompts. |
Roblox reference: TextGenerator
Generated from Nova's API dump and Roblox creator-docs. Nova-only members come from the engine's reflection metadata.