From af7896b90048225c416f4933a54b80aedb35f943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?George=C2=B7Dong?= <98630204+GeorgeDong32@users.noreply.github.com> Date: Tue, 6 Jan 2026 21:45:27 +0800 Subject: [PATCH] fix(prompts): standardize tool use example format to use 'A:' label consistently (#12313) - Changed all 'Assistant:' labels to 'A:' in tool use examples for consistency - Added missing blank line before final response in both files - Affects promptToolUsePlugin.ts and prompt.ts - Resolves #12310 --- .../toolUsePlugin/promptToolUsePlugin.ts | 3 ++- src/renderer/src/utils/prompt.ts | 17 +++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/packages/aiCore/src/core/plugins/built-in/toolUsePlugin/promptToolUsePlugin.ts b/packages/aiCore/src/core/plugins/built-in/toolUsePlugin/promptToolUsePlugin.ts index 224cee05ae..67dd33e9e0 100644 --- a/packages/aiCore/src/core/plugins/built-in/toolUsePlugin/promptToolUsePlugin.ts +++ b/packages/aiCore/src/core/plugins/built-in/toolUsePlugin/promptToolUsePlugin.ts @@ -154,7 +154,8 @@ User: search 26 million (2019) -Assistant: The population of Shanghai is 26 million, while Guangzhou has a population of 15 million. Therefore, Shanghai has the highest population.` + +A: The population of Shanghai is 26 million, while Guangzhou has a population of 15 million. Therefore, Shanghai has the highest population.` /** * 构建可用工具部分(提取自 Cherry Studio) diff --git a/src/renderer/src/utils/prompt.ts b/src/renderer/src/utils/prompt.ts index 4e799800a7..326392947a 100644 --- a/src/renderer/src/utils/prompt.ts +++ b/src/renderer/src/utils/prompt.ts @@ -14,7 +14,7 @@ Here are a few examples using notional tools: --- User: Generate an image of the oldest person in this document. -Assistant: I can use the document_qa tool to find out who the oldest person is in the document. +A: I can use the document_qa tool to find out who the oldest person is in the document. document_qa {"document": "document.pdf", "question": "Who is the oldest person mentioned?"} @@ -25,7 +25,7 @@ User: John Doe, a 55 year old lumberjack living in Newfoundland. -Assistant: I can use the image_generator tool to create a portrait of John Doe. +A: I can use the image_generator tool to create a portrait of John Doe. image_generator {"prompt": "A portrait of John Doe, a 55-year-old man living in Canada."} @@ -36,12 +36,12 @@ User: image.png -Assistant: the image is generated as image.png +A: the image is generated as image.png --- User: "What is the result of the following operation: 5 + 3 + 1294.678?" -Assistant: I can use the python_interpreter tool to calculate the result of the operation. +A: I can use the python_interpreter tool to calculate the result of the operation. python_interpreter {"code": "5 + 3 + 1294.678"} @@ -52,12 +52,12 @@ User: 1302.678 -Assistant: The result of the operation is 1302.678. +A: The result of the operation is 1302.678. --- User: "Which city has the highest population , Guangzhou or Shanghai?" -Assistant: I can use the search tool to find the population of Guangzhou. +A: I can use the search tool to find the population of Guangzhou. search {"query": "Population Guangzhou"} @@ -68,7 +68,7 @@ User: Guangzhou has a population of 15 million inhabitants as of 2021. -Assistant: I can use the search tool to find the population of Shanghai. +A: I can use the search tool to find the population of Shanghai. search {"query": "Population Shanghai"} @@ -78,7 +78,8 @@ User: search 26 million (2019) -Assistant: The population of Shanghai is 26 million, while Guangzhou has a population of 15 million. Therefore, Shanghai has the highest population. + +A: The population of Shanghai is 26 million, while Guangzhou has a population of 15 million. Therefore, Shanghai has the highest population. ` export const AvailableTools = (tools: MCPTool[]) => {