Aprenda
Classe do mecanismo
TextGenerator

*Este conteúdo é traduzido por IA (Beta) e pode conter erros. Para ver a página em inglês, clique aqui.


Resumo
Membros herdados
Amostras de código
local Workspace = game:GetService("Workspace")
local textGenerator = Instance.new("TextGenerator")
textGenerator.Parent = Workspace
textGenerator.SystemPrompt = "Você é um NPC útil em um 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 Gerado: " .. response.GeneratedText)
print("Token de Contexto: " .. response.ContextToken)
print("Modelo: " .. response.Model)
return response
end
else
warn("Falha na geração de texto: " .. tostring(response))
end
return nil
end
getResponse("Me conte algo legal.")

Referência API
Propriedades
Seed
Ler Parallel
TextGenerator.Seed:number

SystemPrompt
Ler Parallel
TextGenerator.SystemPrompt:string

Temperature
Ler Parallel
TextGenerator.Temperature:number

TopP
Ler Parallel
TextGenerator.TopP:number

Métodos
GenerateTextAsync
Rendimentos
TextGenerator:GenerateTextAsync(request:Dictionary):Dictionary
Parâmetros
request:Dictionary
Devolução

©2026 Roblox Corporation, Roblox, o logotipo Roblox e Powering Imagination estão entre nossas marcas registradas e não registradas nos EUA e em outros países.