Motor Sınıfı
TextGenerator
*Bu içerik, yapay zekâ (beta) kullanılarak çevrildi ve hatalar içerebilir. Sayfayı İngilizce görüntülemek için buraya tıkla.
Kod Örnekleri
local Workspace = game:GetService("Workspace")
local textGenerator = Instance.new("TextGenerator")
textGenerator.Parent = Workspace
textGenerator.SystemPrompt = "Sen sanal bir dünyada yardımcı bir NPC'sin."
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("Üretilen Metin: " .. response.GeneratedText)
print("Bağlam Jetonu: " .. response.ContextToken)
print("Model: " .. response.Model)
return response
end
else
warn("Metin üretimi başarısız oldu: " .. tostring(response))
end
return nil
end
getResponse("Bana ilginç bir şey söyle.")API Referansı
Özellikler
Yöntemler
GenerateTextAsync
Parametreler
Dönüşler