LLMSynthesize[prompt]
入力 prompt に従ってテキストを生成する.
LLMSynthesize[{prompt1,…}]
複数の promptiを結合する.
LLMSynthesize[…,prop]
生成されたテキストの指定された特性を返す.
LLMSynthesize
LLMSynthesize[prompt]
入力 prompt に従ってテキストを生成する.
LLMSynthesize[{prompt1,…}]
複数の promptiを結合する.
LLMSynthesize[…,prop]
生成されたテキストの指定された特性を返す.
詳細とオプション
- LLMSynthesizeは,大規模言語モデル(LLM)を使い,プロンプトで指定された指示に従ってテキストを生成する.この関数は,’コンテンツの作成,文の完成,情報の抽出等ができる.
- LLMSynthesizeは,外部サービスの認証,請求,インターネット接続を必要とする.
- 以下は,prompt の可能な値である.
-
"text" 静的テキスト LLMPrompt["name"] リポジトリプロンプト StringTemplate[…] テンプレートテキスト TemplateObject[…] プロンプト作成用テンプレート Image[…] 画像 {prompt1,…} プロンプトのリスト - テンプレートオブジェクトはTemplateObject[…][]を介して自動的に文字列に変換される.
- TemplateObjectで作成したプロンプトにはテキストと画像を入れることができる.
- すべてのLLMが画像入力をサポートする訳ではない.
- 次は,prop のサポートされている値である.
-
"CompletionText" LLMからのテキストによる答 "CompletionToolsText" ツールとのインタラクションを含んだテキストによる答 "FormattedBoxes" Notebook Assistantボックスとしてフォーマットされた完成文 "FormattedText" フォーマットされた"Markdown"完成文 "FullText" "History"の文字列表現 "History" プロンプトと完成文を含む完全な履歴 "LLMEvaluator" ランタイムのLLMEvaluator値 "NotebookObject" 新規のノートブック内のフォーマットされた完成文 "Prompt" LLMに送信されたコンテンツ "PromptText" "Prompt"の文字列表現 "ToolRequests" LLMToolRequestオブジェクトのリスト "ToolResponses" LLMToolResponseオブジェクトのリスト "Usage" 使用法のトークン {prop1,prop2,…} 複数の特性 All すべての特性 - "FullTextAnnotations","ToolRequests"および"ToolResponses"は{start,end}val の形式の要素を含む連想を返す.ただし,val はオブジェクトを参照し,start と end は文字列の範囲を参照する.val は"FullText"で指定される.
- 次は,指定可能なオプションである.
-
Authentication Automatic 認証スキーム LLMEvaluator $LLMEvaluator 使用するLLM設定 ProgressReporting $ProgressReporting 計算の進捗状況の報告方法 - LLMEvaluatorは,LLMConfigurationオブジェクトまたは以下のキーの任意のものを含む連想に設定できる.
-
"MaxTokens" 生成するトークンの最大数 "Model" ベースモデル "PromptDelimiter" プロンプト間に使用するデリミタ "Prompts" 初期プロンプトまたはLLMPromptGeneratorオブジェクト "StopTokens" 生成を止めるトークン "Temperature" サンプリング温度 "ToolMethod" ツールの呼出しに使用するメソッド "Tools" 使用可能にするLLMToolオブジェクトのリスト "TopProbabilities" サンプリングクラスのカットオフ "TotalProbabilityCutoff" サンプリング確率のカットオフ(核サンプリング) - 次は,"Model"の有効な形式である.
-
name 名前付きのモデル {service,name} service からの名前付きのモデル <|"Service"service,"Name"name,"Task"task|> 完全に指定されたモデル - タスクの可能な値には"Chat"と"Completion"がある.
- 生成されたテキストは,配布物からサンプリングされる.サンプリングの詳細は,LLMEvaluatorの以下の特性で指定できる.
-
"Temperature"t Automatic 正の温度 t を使ったサンプリング "TopProbabilities"k Automatic 最もありそうな k 個のクラスのみからのサンプリング "TotalProbabilityCutoff"p Automatic 最低でも p の累積確率を持つ最もありそうな選択肢からのサンプリング(核サンプリング) - これらのパラメータの値Automaticには,指定された"Model"のデフォルト値が使われる.
- LLMEvaluatorの"Prompts"特性で指定されたプロンプトは,タスクが"Chat"の場合はロール(役割)が"System"に設定されて入力 prompt の前に加えられる.
- 複数のプロンプトはLLMEvaluatorの"PromptDelimiter"特性で分離される.
- 次は,Authenticationの可能な値である.
-
Automatic 認証スキームを自動選択する Environment 環境変数のキーをチェックする SystemCredential システムキーチェーンのキーをチェックする ServiceObject[…] サービスオブジェクトから認証を継承する "string" 明示的なAPIキーを与える - AuthenticationAutomaticのとき,関数はEnvironmentとSystemCredentialの変数ToUpperCase[service]<>"_API_KEY"をチェックする.それ以外の場合はServiceConnect[service]が使われる.
- LLMSynthesizeは機械学習を使う.含まれるメソッド,訓練集合,バイアスはWolfram言語のバージョンによって異なることがあり,与えられる結果も異なる可能性がある.
例題
すべて開く すべて閉じる例 (3)
スコープ (4)
LLMSynthesize["the product of 5 and 6 is "]LLMSynthesize[{"what is this image?", [image], "Tell me just one word about it"}, LLMEvaluator -> <|"Model" -> {"OpenAI", "gpt-4o"}|>]LLMSynthesize["the product of 5 and 6 is ", "FullText"]完成文のテキストをフォーマットされたボックスとしてインポートする:
LLMSynthesize["what is the tallest mountain?", "FormattedBoxes", LLMEvaluator -> "AgentOne"]オプション (10)
Authentication (4)
LLMSynthesize["the product of 5 and 6 is ", Authentication -> "<my-key>"]オペレーティングシステムのキーチェーンを使ってAPIキーを格納する:
SystemCredential["OPENAI_API_KEY"] = "<my-key>"LLMSynthesize["the product of 5 and 6 is ", Authentication -> SystemCredential]SetEnvironment["OPENAI_API_KEY" -> "<my-key>"]LLMSynthesize["the product of 5 and 6 is ", Authentication -> Environment]so = ServiceConnect["OpenAI"]LLMSynthesize["the product of 5 and 6 is ", Authentication -> so]LLMEvaluator (5)
LLMSynthesize["the first 100 digits of Pi", LLMEvaluator -> "WolframAIAssistant"]デフォルトで,テキスト生成は終了トークンが生成されるまで継続する:
LLMSynthesize["answer with only the first 20 digits of Pi"]LLMSynthesize["answer with only the first 20 digits of Pi", LLMEvaluator -> <|"Model" -> "gpt-4o-mini", "MaxTokens" -> 3|>]Table[LLMSynthesize["Answer with random a color", LLMEvaluator -> <|"Model" -> "gpt-4o-mini", "Temperature" -> 0|>], 3]Table[LLMSynthesize["Answer with a random color", LLMEvaluator -> <|"Model" -> "gpt-4o-mini", "Temperature" -> 1.5|>], 3]LLMSynthesize["What's the plural of mouse?", LLMEvaluator -> <|"TotalProbabilityCutoff" -> .2, "Model" -> "gpt-4o-mini"|>]LLMSynthesize["What's the plural of mouse?", LLMEvaluator -> <|"Model" -> {"Anthropic", "claude-haiku-4-5-20251001"}|>]アプリケーション (2)
promptfunction[prompt_][args___] := LLMSynthesize[TemplateApply[prompt, {args}]]synonyms = promptfunction["write `2` synonyms of `1`"]synonyms["city", 2]LLMSynthesize["Plot a rational polynomial in the complex plane", "FormattedBoxes", LLMEvaluator -> "WolframAIAssistant"]ComplexPlot[(z ^ 2 + 1) / (z ^ 2 - 1), {z, -2 - 2 I, 2 + 2 I}]考えられる問題 (3)
pi = LLMSynthesize["Pi to the 57th decimal digit"]StringLength[pi]N[Pi, 57 + 1]モデルの中には,利用可能な生成設定の部分集合のみをサポートするものがある:
LLMSynthesize["Answer with random a color", LLMEvaluator -> <|"Temperature" -> 0|>]推論用のもの等,モデルによって使用されるトークンは,出力には現れない場合がある:
LLMSynthesize["answer with only the first 20 digits of Pi", LLMEvaluator -> <|"MaxTokens" -> 3|>]関連するガイド
-
▪
- 機械学習 ▪
- 知識の表現と利用 ▪
- 自然言語処理 ▪
- 大規模言語モデル関連機能 ▪
- テキストの生成 ▪
- 自動化されたレポート ▪
- 外部サービスとAPIへのアクセス ▪
- テキストの操作 ▪
- 文字列操作 ▪
- 式と文字列の間の変換 ▪
- ニューラルネットワーク ▪
- テキスト解析
テキスト
Wolfram Research (2023), LLMSynthesize, Wolfram言語関数, https://reference.wolfram.com/language/ref/LLMSynthesize.html (2026年に更新).
CMS
Wolfram Language. 2023. "LLMSynthesize." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2026. https://reference.wolfram.com/language/ref/LLMSynthesize.html.
APA
Wolfram Language. (2023). LLMSynthesize. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LLMSynthesize.html
BibTeX
@misc{reference.wolfram_2026_llmsynthesize, author="Wolfram Research", title="{LLMSynthesize}", year="2026", howpublished="\url{https://reference.wolfram.com/language/ref/LLMSynthesize.html}", note=[Accessed: 15-November-2026]}
BibLaTeX
@online{reference.wolfram_2026_llmsynthesize, organization={Wolfram Research}, title={LLMSynthesize}, year={2026}, url={https://reference.wolfram.com/language/ref/LLMSynthesize.html}, note=[Accessed: 15-November-2026]}