update README
parent
e3592ca063
commit
f307e88e78
23
README.md
23
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!
|
Let's embrace local LLM agents w/ humanus.cpp!
|
||||||
|
|
||||||
## Overview
|
## Overview
|
||||||
|
```bash
|
||||||
humanus.cpp/
|
humanus.cpp/
|
||||||
├── 📄 config.cpp/.h # 配置系统头文件
|
├── 📄 config.cpp/.h # 配置系统头文件
|
||||||
├── 📄 llm.cpp/.h # LLM集成主实现文件
|
├── 📄 llm.cpp/.h # LLM集成主实现文件
|
||||||
|
@ -39,7 +39,7 @@ humanus.cpp/
|
||||||
├── 📄 python_execute.h # Python执行工具
|
├── 📄 python_execute.h # Python执行工具
|
||||||
├── 📄 terminate.h # 终止工具
|
├── 📄 terminate.h # 终止工具
|
||||||
└── 📄 tool_collection.h # 工具集合定义
|
└── 📄 tool_collection.h # 工具集合定义
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
@ -55,13 +55,26 @@ cmake --build build --config Release
|
||||||
|
|
||||||
## How to Run
|
## 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
|
```bash
|
||||||
./build/bin/humanus_server # Unix/MacOS
|
./build/bin/mcp_server # Unix/MacOS
|
||||||
```
|
```
|
||||||
|
|
||||||
```shell
|
```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):
|
Run agent `Humanus` with tools `python_execute`, `filesystem` and `puppeteer` (for browser use):
|
||||||
|
|
2
config.h
2
config.h
|
@ -106,7 +106,7 @@ struct ToolParser {
|
||||||
{"function", json::parse(tool_content)}
|
{"function", json::parse(tool_content)}
|
||||||
});
|
});
|
||||||
tool_calls.back()["id"] = "call_" + std::to_string(std::chrono::system_clock::now().time_since_epoch().count());
|
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);
|
throw std::runtime_error("Invalid tool call: " + tool_content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
2
mcp
2
mcp
|
@ -1 +1 @@
|
||||||
Subproject commit 4536d45a9e18def8d88a41b95b4fa17bc5e574d6
|
Subproject commit 5e9ff48b070a11ba20529feb22c68d0e9ef46f3d
|
Loading…
Reference in New Issue