学ぶ
エンジンクラス
TextGenerator

*このコンテンツは、ベータ版のAI(人工知能)を使用して翻訳されており、エラーが含まれている可能性があります。このページを英語で表示するには、 こちら をクリックしてください。


概要
継承されたメンバー
コードサンプル
local Workspace = game:GetService("Workspace")
local textGenerator = Instance.new("TextGenerator")
textGenerator.Parent = Workspace
textGenerator.SystemPrompt = "あなたは仮想世界の役に立つNPCです。"
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("生成されたテキスト: " .. response.GeneratedText)
print("コンテキストトークン: " .. response.ContextToken)
print("モデル: " .. response.Model)
return response
end
else
warn("テキスト生成に失敗しました: " .. tostring(response))
end
return nil
end
getResponse("何かクールなことを教えてください。")

APIリファレンス
プロパティ
Seed
並列読み取り
機能: Basic
TextGenerator.Seed:number

SystemPrompt
並列読み取り
機能: Basic
TextGenerator.SystemPrompt:string

Temperature
並列読み取り
機能: Basic
TextGenerator.Temperature:number

TopP
並列読み取り
機能: Basic
TextGenerator.TopP:number

方法
GenerateTextAsync
イールド
機能: Basic
TextGenerator:GenerateTextAsync(request:Dictionary):Dictionary
パラメータ
request:Dictionary
戻り値

©2026 Roblox Corporation。Roblox(ロブロックス)、RobloxロゴおよびPowering Imaginationは、米国並びにその他の国における登録商標および非登録商標です。