diff --git a/README.md b/README.md index 8683192..d1731f0 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Humanus (meaning "human" in Latin) is a lightweight framework inspired by OpenMa Let's embrace local LLM agents w/ humanus.cpp! ## Overview - +```bash humanus.cpp/ ├── 📄 config.cpp/.h # 配置系统头文件 ├── 📄 llm.cpp/.h # LLM集成主实现文件 @@ -39,7 +39,7 @@ humanus.cpp/ ├── 📄 python_execute.h # Python执行工具 ├── 📄 terminate.h # 终止工具 └── 📄 tool_collection.h # 工具集合定义 - +``` ## Features @@ -55,13 +55,26 @@ cmake --build build --config Release ## How to Run -Start a MCP server with tool python_execute` on port 8818: +Switch to your own configration first: +1. Replace `base_url`, `api_key`, .etc in `config/config_llm.toml` according to your need. +2. Fill in `args` after `"@modelcontextprotocol/server-filesystem"` for `filesystem` to control the access to files. For example: +``` +[filesystem] +type = "stdio" +command = "npx" +args = ["-y", + "@modelcontextprotocol/server-filesystem", + "/Users/{username}/Desktop", + "other/path/to/your/files] +``` + +Start a MCP server with tool `python_execute` on port 8818: ```bash -./build/bin/humanus_server # Unix/MacOS +./build/bin/mcp_server # Unix/MacOS ``` ```shell -.\build\bin\Release\humanus_server.exe # Windows +.\build\bin\Release\mcp_server.exe # Windows ``` Run agent `Humanus` with tools `python_execute`, `filesystem` and `puppeteer` (for browser use): diff --git a/config.h b/config.h index 7b617b9..43f83f0 100644 --- a/config.h +++ b/config.h @@ -106,7 +106,7 @@ struct ToolParser { {"function", json::parse(tool_content)} }); tool_calls.back()["id"] = "call_" + std::to_string(std::chrono::system_clock::now().time_since_epoch().count()); - } catch (const json::exception& e) { + } catch (const json::exception& /* e */) { throw std::runtime_error("Invalid tool call: " + tool_content); } } diff --git a/mcp b/mcp index 4536d45..5e9ff48 160000 --- a/mcp +++ b/mcp @@ -1 +1 @@ -Subproject commit 4536d45a9e18def8d88a41b95b4fa17bc5e574d6 +Subproject commit 5e9ff48b070a11ba20529feb22c68d0e9ef46f3d