diff --git a/src/prompt.cpp b/src/prompt.cpp index 6d1f460..7c834dd 100644 --- a/src/prompt.cpp +++ b/src/prompt.cpp @@ -16,11 +16,13 @@ const char* NEXT_STEP_PROMPT = R"(You can interact with the computer using pytho Based on user needs, proactively select the most appropriate tool or combination of tools. For complex tasks, you can break down the problem and use different tools step by step to solve it. -After using each tool, clearly explain the execution results and suggest the next steps. If you finish the current step, call `terminate` to switch to next step. +After using each tool, clearly explain the execution results and suggest the next steps. Unless required by user, you should always at most use one tool at a time, observe the result and then choose the next tool or action. -Detect the language of the user input and respond in the same language for thoughts.)"; +Detect the language of the user input and respond in the same language for thoughts. + +Basically the user will not reply to you, you should make decisions and determine whether current step is finished. If you finish the current step, call `terminate`.)"; } // namespace humanus namespace toolcall { diff --git a/tool/base.h b/tool/base.h index d240a59..aba1a5c 100644 --- a/tool/base.h +++ b/tool/base.h @@ -100,10 +100,6 @@ struct BaseTool { // Execute the tool with given parameters. struct BaseMCPTool : BaseTool { - std::string name; - std::string description; - json parameters; - std::unique_ptr _client; BaseMCPTool(const std::string& name, const std::string& description, const json& parameters) diff --git a/tool/tool_collection.h b/tool/tool_collection.h index 3f671a3..91946f6 100644 --- a/tool/tool_collection.h +++ b/tool/tool_collection.h @@ -26,7 +26,7 @@ struct ToolCollection { ToolResult execute(const std::string& name, const json& args) const { auto tool_iter = tools_map.find(name); if (tool_iter == tools_map.end()) { - return ToolError("Tool " + name + " is invalid"); + return ToolError("Tool `" + name + "` not found"); } try { return tool_iter->second->execute(args);