Ghi chú phát hành
Học
Lớp công cụ
TextGenerator

*Nội dung này được dịch bằng AI (Beta) và có thể có lỗi. Để xem trang này bằng tiếng Anh, hãy nhấp vào đây.


Tóm Tắt
Phương Pháp
Thành viên kế thừa
Mẫu mã
local Workspace = game:GetService("Workspace")
local textGenerator = Instance.new("TextGenerator")
textGenerator.Parent = Workspace
textGenerator.SystemPrompt = "Bạn là một NPC hữu ích trong một thế giới ảo."
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("Văn bản được tạo ra: " .. response.GeneratedText)
print("Token ngữ cảnh: " .. response.ContextToken)
print("Mô hình: " .. response.Model)
return response
end
else
warn("Tạo văn bản thất bại: " .. tostring(response))
end
return nil
end
getResponse("Kể cho tôi điều gì đó thú vị.")

Tài Liệu Tham Khảo API
Thuộc Tính
Seed
Đọc Song Song
Các khả năng: Basic
TextGenerator.Seed:number

SystemPrompt
Đọc Song Song
Các khả năng: Basic
TextGenerator.SystemPrompt:string

Temperature
Đọc Song Song
Các khả năng: Basic
TextGenerator.Temperature:number

TopP
Đọc Song Song
Các khả năng: Basic
TextGenerator.TopP:number

Phương Pháp
GenerateTextAsync
Sinh Lợi
Các khả năng: Basic
TextGenerator:GenerateTextAsync(request:Dictionary):Dictionary
Tham Số
request:Dictionary
Lợi Nhuận

©2026 Roblox Corporation. Roblox, logo Roblox và Powering Imagination là các nhãn hiệu đã đăng ký và chưa đăng ký của chúng tôi tại Hoa Kỳ và các quốc gia khác.