SuperAPI AI 工具集

arize-prompt-optimization

智能体与模型

查看项目

更新于 10-15 17:18

技能介绍

该技能用于从 Arize 的 trace、数据集和实验中优化 LLM 提示词。提示词在 trace 中按 span 类型存放于不同属性:LLM span 的 attributes.llm.input_messages 存结构化聊天消息,attributes.input.value 存序列化提示词,attributes.llm.prompt_template.template 存含 {variable} 占位符的模板;Chain/Agent span 的提示词位于子 LLM span。性能信号来自标注(annotation.<name>.label/score/text)、评估(eval.<name>.label/score/explanation)及输入输出属性。流程分四阶段:提取当前提示词(用 ax spans export 导出并按 jq 解析)、收集性能数据(导出数据集与实验,按 example_id 合并,用 jq 找出低分样例)、优化提示词(填写 optimization-meta-prompt 交给 LLM 生成改进版)、迭代(创建新实验、对比平均分与失败翻转)。用法依赖 ax CLI 命令,如 ax spaces list、ax profiles show、ax projects list、ax datasets export、ax experiments export 等;凭证通过 ax profiles 管理,LLM 提供商凭证通过 ax ai-integrations 管理,不应让用户在对话中粘贴密钥,也不应读取 .env 文件。限制:optimization-meta-prompt 的具体内容与部分参考资料未在本次资料中完整提供;实际效果取决于是否有可用的 trace、数据集和评估数据。分类为智能体与模型。