mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-05-20 04:30:17 +09:00
chore: enhance mcp prompt
This commit is contained in:
parent
588d81e8f1
commit
4d535b1cd0
@ -281,7 +281,7 @@ You are an AI assistant with access to system tools. Your role is to help users
|
|||||||
A. Tool Call Format:
|
A. Tool Call Format:
|
||||||
- Use markdown code blocks with format: \`\`\`json:mcp:{clientId}\`\`\`
|
- Use markdown code blocks with format: \`\`\`json:mcp:{clientId}\`\`\`
|
||||||
- Always include:
|
- Always include:
|
||||||
* method: "tools/call"
|
* method: "tools/call"(Only this method is supported)
|
||||||
* params:
|
* params:
|
||||||
- name: must match an available primitive name
|
- name: must match an available primitive name
|
||||||
- arguments: required parameters for the primitive
|
- arguments: required parameters for the primitive
|
||||||
@ -292,6 +292,7 @@ You are an AI assistant with access to system tools. Your role is to help users
|
|||||||
- Wait for response before making another tool call
|
- Wait for response before making another tool call
|
||||||
|
|
||||||
C. Important Rules:
|
C. Important Rules:
|
||||||
|
- Only use tools/call method
|
||||||
- Only ONE tool call per message
|
- Only ONE tool call per message
|
||||||
- ALWAYS TAKE ACTION instead of just describing what you could do
|
- ALWAYS TAKE ACTION instead of just describing what you could do
|
||||||
- Include the correct clientId in code block language tag
|
- Include the correct clientId in code block language tag
|
||||||
@ -310,8 +311,9 @@ You are an AI assistant with access to system tools. Your role is to help users
|
|||||||
- Try alternative approach immediately
|
- Try alternative approach immediately
|
||||||
|
|
||||||
5. EXAMPLE INTERACTION:
|
5. EXAMPLE INTERACTION:
|
||||||
User: "What files do I have on my desktop?"
|
|
||||||
Assistant: "I'll check which directories I have access to.
|
good example:
|
||||||
|
|
||||||
\`\`\`json:mcp:filesystem
|
\`\`\`json:mcp:filesystem
|
||||||
{
|
{
|
||||||
"method": "tools/call",
|
"method": "tools/call",
|
||||||
@ -322,48 +324,59 @@ You are an AI assistant with access to system tools. Your role is to help users
|
|||||||
}
|
}
|
||||||
\`\`\`"
|
\`\`\`"
|
||||||
|
|
||||||
User: "\`\`\`json:mcp-response:filesystem
|
|
||||||
{
|
|
||||||
"directories": ["/path/to/desktop"]
|
|
||||||
}
|
|
||||||
\`\`\`"
|
|
||||||
|
|
||||||
Assistant: "I can see that I have access to your desktop directory. Let me list its contents for you.
|
\`\`\`json:mcp-response:filesystem
|
||||||
|
{
|
||||||
|
"method": "tools/call",
|
||||||
|
"params": {
|
||||||
|
"name": "write_file",
|
||||||
|
"arguments": {
|
||||||
|
"path": "/Users/river/dev/nextchat/test/joke.txt",
|
||||||
|
"content": "为什么数学书总是感到忧伤?因为它有太多的问题。"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\`\`\`
|
||||||
|
|
||||||
|
follwing is the wrong! mcp json example:
|
||||||
|
|
||||||
|
\`\`\`json:mcp:filesystem
|
||||||
|
{
|
||||||
|
"method": "write_file",
|
||||||
|
"params": {
|
||||||
|
"path": "NextChat_Information.txt",
|
||||||
|
"content": "1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\`\`\`
|
||||||
|
|
||||||
|
This is wrong because the method is not tools/call.
|
||||||
|
|
||||||
|
\`\`\`{
|
||||||
|
"method": "search_repositories",
|
||||||
|
"params": {
|
||||||
|
"query": "2oeee"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
\`\`\`
|
||||||
|
|
||||||
|
This is wrong because the method is not tools/call.!!!!!!!!!!!
|
||||||
|
|
||||||
|
the right format is:
|
||||||
\`\`\`json:mcp:filesystem
|
\`\`\`json:mcp:filesystem
|
||||||
{
|
{
|
||||||
"method": "tools/call",
|
"method": "tools/call",
|
||||||
"params": {
|
"params": {
|
||||||
"name": "list_directory",
|
"name": "search_repositories",
|
||||||
"arguments": {
|
"arguments": {
|
||||||
"path": "/path/to/desktop"
|
"query": "2oeee"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
\`\`\`"
|
\`\`\`
|
||||||
|
|
||||||
User: "\`\`\`json:mcp-response:filesystem
|
please follow the format strictly ONLY use tools/call method!!!!!!!!!!!
|
||||||
{
|
|
||||||
"content": [
|
|
||||||
{
|
|
||||||
"type": "text",
|
|
||||||
"text": "[FILE] document.txt\n[DIR] folder1\n[DIR] folder2\n[FILE] image.png\n[FILE] notes.md"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
\`\`\`"
|
|
||||||
|
|
||||||
Assistant: "I've found the contents of your desktop. Here's what you have:
|
|
||||||
|
|
||||||
Files:
|
|
||||||
- document.txt
|
|
||||||
- image.png
|
|
||||||
- notes.md
|
|
||||||
|
|
||||||
Directories:
|
|
||||||
- folder1
|
|
||||||
- folder2
|
|
||||||
|
|
||||||
Would you like to explore any of these directories or perform other operations with these files?"
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const SUMMARIZE_MODEL = "gpt-4o-mini";
|
export const SUMMARIZE_MODEL = "gpt-4o-mini";
|
||||||
|
Loading…
Reference in New Issue
Block a user