建议增加提示词中示例代码兼容其他模型
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start with mindsearch/agent/mindsearch_prompt.py and compare the existing searcher_system_prompt_cn and GRAPH_PROMPT_CN examples with the proposed format. Check how the prompts are consumed, then verify that the revised examples work with qwen, deepseek, and claude; the work is done when those models can run the demonstrated search graph successfully.
Written by the indexing model from the issue text.
Description
我的实践,在提示词中增加fow shot,可以让qwen, deepseek, cluade也能跑通。修改如下:
# mindsearch/agent/mindsearch_prompt.py
searcher_system_prompt_cn = """## 人物简介
你是一个可以调用网络搜索工具的智能助手。请根据"当前问题",调用搜索工具收集信息并回复问题,注意一次回答只能调用一个工具,请在多轮回答中使用多次工具。你能够调用如下工具:
…省略…
## 要求
- 基于"当前问题"的搜索结果,撰写详细完备的回复,优先回答"当前问题"。如果上下文中没有可以回答问题的信息,不生成问题回复,不要编造回答。
…省略…
GRAPH_PROMPT_CN = """## 人物简介
…省略…
## 注意事项
1. 注意,每个搜索节点的内容必须单个问题,不要包含多个问题(比如同时问多个知识点的问题或者多个事物的比较加筛选,类似 A, B, C 有什么区别,那个价格在哪个区间 -> 分别查询)
2. 不要杜撰搜索结果,要等待代码返回结果
3. 同样的问题不要重复提问,可以在已有问题的基础上继续提问
4. 一次输出中,不要包含多个代码块,每次只能有一个代码块
5. 每个代码块应该放置在一个代码块标记中,同时生成完代码后添加一个<|action_end|>标志,如下所示:
<|action_start|><|interpreter|>```python
# 你的代码块
```<|action_end|>
6. 一个代码块中,一个节点必须和一条边相连,并最后调用node方法获取结果。
7. 整个图构建最后一次回复应该是添加node_name为'response'的 response 节点,必须添加 response 节点,不要添加其他节点。 添加 response 节点的时候,要单独添加,不要和其他节点一起添加,不能同时添加 response 节点和其他节点
示例(注意这是多次的回答而不是单次的):
<|action_start|><|interpreter|>```python
graph = WebSearchGraph()
# 添加根节点
graph.add_root_node(node_content="人工智能的最新进展有哪些?\", node_name="root")
# 添加搜索节点
graph.add_node(node_name="key_areas", node_content="人工智能研究的关键领域有哪些?")
# 添加边,表示搜索节点之间的关系
graph.add_edge(start_node="key_areas", end_node="trends")
# 读取节点的查询结果并打印出来
graph.node("key_areas")
```<|action_end|>
<|action_start|><|interpreter|>```python
# 添加根节点
graph.add_node(node_name="trends", node_content="机器学习的最新趋势是什么?")
graph.add_edge(start_node="key_areas", end_node="trends")
graph.node("trends")
```<|action_end|>
<|action_start|><|interpreter|>```python
graph.add_response_node(node_name="response")
graph.add_edge(start_node="trends", end_node="response")
```<|action_end|>
…省略…
- Dominant language
- JavaScript
- Stars
- 7k
- Forks
- 684
- PR merge metrics
- No merged PRs in 30d
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from InternLM/MindSearch
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
InternLM/MindSearch#326 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
InternLM/MindSearch#315 ·
-
问答只回复一次,没有完整推理搜索回复Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
InternLM/MindSearch#312 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
InternLM/MindSearch#311 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
InternLM/MindSearch#310 ·
All issues in InternLM/MindSearch
Similar issues
-
area/frontend good first issue topic/intents
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
aws-samples/sample-collaborative-ai-dlc#1049 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
avniproject/avni-client#2268 ·
-
plugins/dsh: todayStr() computes UTC but is documented as local — journal entries written 00:00–08:00 local land in the previous day's filePossibly taken @Beehtrix claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
zilliztech/memsearch#907 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
we-promise/sure#6115 ·
Maintainers usually reply within 1 day
-
withImplementation leaves the temporary mock installed when its callback throws or rejectsPossibly taken @Cynnamoroll claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 10 days