Aprender
Clase de motor
TextGenerator

*Este contenido se traduce usando la IA (Beta) y puede contener errores. Para ver esta página en inglés, haz clic en aquí.


Resumen
Miembros heredados
Muestras de código
local Workspace = game:GetService("Workspace")
local textGenerator = Instance.new("TextGenerator")
textGenerator.Parent = Workspace
textGenerator.SystemPrompt = "Eres un NPC útil en un mundo virtual."
textGenerator.Temperature = 0.8
textGenerator.TopP = 0.6
textGenerator.Seed = 7
local function getResponse(userInput)
local request = {
UserPrompt = userInput,
MaxTokens = 50
}
local success, response = pcall(function()
return textGenerator:GenerateTextAsync(request)
end)
if success then
if response then
print("Texto Generado: " .. response.GeneratedText)
print("Token de Contexto: " .. response.ContextToken)
print("Modelo: " .. response.Model)
return response
end
else
warn("La generación de texto falló: " .. tostring(response))
end
return nil
end
getResponse("Dime algo genial.")

Referencia API
Propiedades
Seed
Leer paralelo
Capacidades: Basic
TextGenerator.Seed:number

SystemPrompt
Leer paralelo
Capacidades: Basic
TextGenerator.SystemPrompt:string

Temperature
Leer paralelo
Capacidades: Basic
TextGenerator.Temperature:number

TopP
Leer paralelo
Capacidades: Basic
TextGenerator.TopP:number

Métodos
GenerateTextAsync
Proporciona
Capacidades: Basic
TextGenerator:GenerateTextAsync(request:Dictionary):Dictionary
Parámetros
request:Dictionary
Devuelve

©2026 Roblox Corporation. Roblox, el logotipo de Roblox y "Powering Imagination" son algunas de nuestras marcas registradas y no registradas en los Estados Unidos y otros países.