Impara
Classe motore
TextGenerator

*Questo contenuto è tradotto usando AI (Beta) e potrebbe contenere errori. Per visualizzare questa pagina in inglese, clicca qui.


Sommario
Membri ereditati
Campioni di codice
local Workspace = game:GetService("Workspace")
local textGenerator = Instance.new("TextGenerator")
textGenerator.Parent = Workspace
textGenerator.SystemPrompt = "Sei un NPC utile in un mondo virtuale."
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("Testo generato: " .. response.GeneratedText)
print("Token di contesto: " .. response.ContextToken)
print("Modello: " .. response.Model)
return response
end
else
warn("Generazione di testo fallita: " .. tostring(response))
end
return nil
end
getResponse("Raccontami qualcosa di interessante.")

Riferimento API
Proprietà
Seed
Lettura Parallela
Capacità: Basic
TextGenerator.Seed:number

SystemPrompt
Lettura Parallela
Capacità: Basic
TextGenerator.SystemPrompt:string

Temperature
Lettura Parallela
Capacità: Basic
TextGenerator.Temperature:number

TopP
Lettura Parallela
Capacità: Basic
TextGenerator.TopP:number

Metodi
GenerateTextAsync
Resa
Capacità: Basic
TextGenerator:GenerateTextAsync(request:Dictionary):Dictionary
Parametri
request:Dictionary
Restituzioni

© 2026 Roblox Corporation. Roblox, il logo Roblox e Powering Imagination sono tra i nostri marchi registrati e non registrati negli Stati Uniti. e altri paesi.