LLMPromptGenerator
14.1的新功能[试用]
表示使用函数 f 的提示生成器.
LLMPromptGenerator[f,inputspec]
为 f 提供指定的 inputspec.
更多信息

- LLMPromptGenerator 用于向 LLM 提示添加与消息相关的上下文.
- inputspec 的可能值有:
-
"Input" 最后的用户输入(默认) "Messages" 消息列表 "LLMEvaluator" 当前的 LLMConfiguration[…] "ChatObject" 作为 ChatObject[…] 的整个对话 {spec1,…} 输入的关联 - f 的结果必须是有效的提示. 可能的值包括:
-
"string" 静态文本 LLMPrompt["name"] 存储库提示 StringTemplate[…] 模板化文本 TemplateObject[…] 用于创建文本的模板 Image[…] 图像 SemanticSearchIndex[…] 语义搜索索引 {prompt1,…} 提示列表 - 模板对象通过 TemplateObject[…][] 自动转换为字符串.
- 使用 TemplateObject 创建的提示可以包含文本和图像.
- 并非所有 LLM 都支持图像输入.
- 如果 f 的结果不是字符串、字符串列表或图像,则将使用 TextString 进行转换.
范例
打开所有单元关闭所有单元范围 (5)标准用法实例范围调查
函数 (3)
在 SemanticSearchIndex 上定义一个生成器:
可能存在的问题 (1)常见隐患和异常行为
使用 TemplateObject 或 Function 封装列表:
Wolfram Research (2024),LLMPromptGenerator,Wolfram 语言函数,https://reference.wolfram.com/language/ref/LLMPromptGenerator.html.
文本
Wolfram Research (2024),LLMPromptGenerator,Wolfram 语言函数,https://reference.wolfram.com/language/ref/LLMPromptGenerator.html.
CMS
Wolfram 语言. 2024. "LLMPromptGenerator." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/ref/LLMPromptGenerator.html.
APA
Wolfram 语言. (2024). LLMPromptGenerator. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/LLMPromptGenerator.html 年