modelscope / modelscope-agent

ModelScope-Agent: An agent framework connecting models in ModelScope with the world
https://modelscope-agent.readthedocs.io/en/latest/
Apache License 2.0
2.58k stars 293 forks source link

对于论文中提到的数据集生成方法,可以发下代码参考一下吗? #281

Open klsdjft opened 7 months ago

klsdjft commented 7 months ago

对于论文中提到的数据集生成方法,可以发下代码参考一下吗?

在我的场景里有很多自定义工具,包括回复和调用逻辑都不是很通用. 所以我想生成一版Agent testset, 但是如何根据in-context demonstrations 让GPT生成Instruction不太明白. 没有看到开源部分相关的代码. 如果可以的话,请提供下代码参考下~谢谢

https://arxiv.org/pdf/2309.00986.pdf
Initially, a set of random in-context demonstrations were provided to ChatGPT for generating an instruction.This instruction could either be a
regular one or one that requires solving with APIs, depending on the demonstrations provided. Subsequently, ChatGPT was prompt to act as an agent by first thinking about which action to undertake.

image

lcl6679292 commented 6 months ago

你好,我们正在计划结合ms-swift finetune框架搞一套自动数据增强方案,目前的话您可以先参考这个数据集里面的,通过构造few-shot,再给出你需要的工具来生成增强数据:https://modelscope.cn/datasets/iic/MSAgent-Bench/summary

klsdjft commented 6 months ago

你好,我们正在计划结合ms-swift finetune框架搞一套自动数据增强方案,目前的话您可以先参考这个数据集里面的,通过构造few-shot,再给出你需要的工具来生成增强数据:https://modelscope.cn/datasets/iic/MSAgent-Bench/summary

1. 感谢回复!数据集我看过了,您的意思是根据这个数据集的case, 做example(few-shot)让gpt结合我的工具描述 来生成类似的QA-pair吗?这应该是使用一个LLM来完成数据集生成的方法,这个我能理解。

2. 我看到论文中提到会有两个ChatGPT, 一个扮演用户,一个扮演Agent. 我的理解请帮我看看是否正确?: User GPT Prompt:

你将扮演一个用户,输出 不同的需求. 输出例如: { "question":"帮我写一首春天的诗,并用英文翻译" }

Agent GPT Prompt:

你有以下工具, 根据我的需求,输出结果或调用工具的Action... "tools_list": [ "写诗", "翻译", "查天气", "其他干扰选项" ]

输入: 帮我写一首春天的诗,并用英文翻译 输出: { "写诗":"写春天的", "翻译":"..." }

3. 重点问题是, 问题域 -> 问题生成 -> 工具列表创建 -> Agent选择当前step的工具或回复,这个链路是否正确?以及,工具列表创建是跟问题生成一起的(即UserGPT生成的),还是根Agent一起生成的(即AgentGPT的一开始的设定)?

再次感谢您的回复