erlangshen 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/.claude/agents/equity-agent.md +26 -0
  2. package/.claude/agents/macro-agent.md +25 -0
  3. package/.claude/commands/analyze.md +40 -0
  4. package/.claude/commands/macro.md +29 -0
  5. package/.claude/settings.json +12 -0
  6. package/CODEX_GOAL.md +46 -0
  7. package/README.md +206 -0
  8. package/bin/cli.js +67 -0
  9. package/bin/erlangshen +2 -0
  10. package/bin/xiaoergod +2 -0
  11. package/frontend/index.html +700 -0
  12. package/knowledge/crypto_guide.md +147 -0
  13. package/knowledge/economic_indicators.md +125 -0
  14. package/knowledge/financial_glossary.md +148 -0
  15. package/knowledge/first_principles.md +50 -0
  16. package/knowledge/first_principles_deep.md +115 -0
  17. package/knowledge/global_markets.md +173 -0
  18. package/knowledge/insights.md +141 -0
  19. package/knowledge/market_basics.md +116 -0
  20. package/knowledge/memos/session_20260513_003616.json +6 -0
  21. package/knowledge/memos/session_20260513_003822.json +6 -0
  22. package/knowledge/risk_management.md +151 -0
  23. package/knowledge/team_context.md +42 -0
  24. package/knowledge/trading_strategies.md +114 -0
  25. package/package.json +42 -0
  26. package/requirements.txt +14 -0
  27. package/scripts/postinstall.js +188 -0
  28. package/scripts/preuninstall.js +22 -0
  29. package/src/__init__.py +4 -0
  30. package/src/__pycache__/__init__.cpython-313.pyc +0 -0
  31. package/src/agents/__init__.py +3 -0
  32. package/src/agents/base.py +103 -0
  33. package/src/agents/base_agent.py +86 -0
  34. package/src/agents/equity.py +136 -0
  35. package/src/agents/equity_agent.py +91 -0
  36. package/src/agents/erlang.py +165 -0
  37. package/src/agents/macro.py +137 -0
  38. package/src/agents/macro_agent.py +81 -0
  39. package/src/agents/multi_asset.py +147 -0
  40. package/src/agents/multi_asset_agent.py +87 -0
  41. package/src/api/__init__.py +1 -0
  42. package/src/api/__pycache__/__init__.cpython-313.pyc +0 -0
  43. package/src/api/__pycache__/server.cpython-313.pyc +0 -0
  44. package/src/api/cli.py +435 -0
  45. package/src/api/cli_enhanced.py +537 -0
  46. package/src/api/server.py +266 -0
  47. package/src/brain.py +200 -0
  48. package/src/cli.py +153 -0
  49. package/src/commands/__init__.py +3 -0
  50. package/src/commands/analyze.py +131 -0
  51. package/src/commands/macro.py +100 -0
  52. package/src/commands/memo.py +216 -0
  53. package/src/commands/portfolio.py +154 -0
  54. package/src/commands/report.py +228 -0
  55. package/src/commands/risk.py +183 -0
  56. package/src/commands/search.py +183 -0
  57. package/src/commands/stock.py +124 -0
  58. package/src/config.py +327 -0
  59. package/src/core/__init__.py +1 -0
  60. package/src/core/brain.py +645 -0
  61. package/src/core/cerebellum.py +175 -0
  62. package/src/core/investment_universe.py +423 -0
  63. package/src/core/knowledge.py +207 -0
  64. package/src/core/memory.py +115 -0
  65. package/src/hooks/__init__.py +3 -0
  66. package/src/hooks/session_end.py +57 -0
  67. package/src/hooks/session_start.py +75 -0
  68. package/src/knowledge/__init__.py +1 -0
  69. package/src/mcp/__init__.py +3 -0
  70. package/src/mcp/feishu.py +331 -0
  71. package/src/mcp/fund_tools.py +323 -0
  72. package/src/mcp/macro.py +452 -0
  73. package/src/mcp/market.py +331 -0
  74. package/src/mcp/registry.py +168 -0
  75. package/src/network/__init__.py +15 -0
  76. package/src/network/detector.py +125 -0
  77. package/src/network/proxy.py +199 -0
  78. package/src/network/router.py +103 -0
  79. package/src/prompts/__init__.py +1 -0
  80. package/src/prompts/analysis_framework.md +164 -0
  81. package/src/prompts/persona.md +65 -0
  82. package/src/prompts/report_template.md +144 -0
  83. package/src/skills/__init__.py +3 -0
  84. package/src/skills/framework.py +105 -0
  85. package/src/skills/templates.py +342 -0
  86. package/src/tools/__init__.py +1 -0
  87. package/src/tools/file_tools.py +209 -0
  88. package/src/tools/macro_tools.py +152 -0
  89. package/src/tools/market_tools.py +1172 -0
  90. package/src/tools/registry.py +398 -0
  91. package/src/tools/search_tools.py +777 -0
  92. package/tests/__init__.py +1 -0
  93. package/tests/test_erlangshen.py +140 -0
@@ -0,0 +1,114 @@
1
+ # 交易策略库
2
+
3
+ ## 趋势跟踪策略
4
+
5
+ ### 均线策略
6
+
7
+ #### 双均线策略
8
+ - **参数**: MA20 + MA60
9
+ - **信号**:
10
+ - 金叉 (MA20上穿MA60) → 买入
11
+ - 死叉 (MA20下穿MA60) → 卖出
12
+ - **周期**: 日线为主
13
+
14
+ #### 多均线策略
15
+ - **参数**: MA20, MA60, MA120, MA200
16
+ - **信号**: 价格站上所有均线且均线多头排列 → 买入
17
+
18
+ ### MACD策略
19
+ - **参数**: 12, 26, 9
20
+ - **信号**:
21
+ - MACD线金叉Signal线 → 买入
22
+ - MACD线死叉Signal线 → 卖出
23
+ - MACD柱由负转正 → 买入
24
+
25
+ ### 布林带策略
26
+ - **参数**: 20日均线, ±2标准差
27
+ - **信号**:
28
+ - 价格触及下轨 → 买入
29
+ - 价格触及上轨 → 卖出
30
+ - 布林带收口 → 突破方向确认
31
+
32
+ ## 均值回归策略
33
+
34
+ ### RSI策略
35
+ - **参数**: 14日RSI
36
+ - **信号**:
37
+ - RSI<30 → 超卖, 买入信号
38
+ - RSI>70 → 超买, 卖出信号
39
+ - RSI<20 → 极度超卖
40
+
41
+ ### KD指标策略
42
+ - **参数**: 9, 3, 3
43
+ - **信号**:
44
+ - K值<20且金叉D值 → 买入
45
+ - K值>80且死叉D值 → 卖出
46
+
47
+ ### 布林带均值回归
48
+ - **参数**: 20日均线, ±2标准差
49
+ - **信号**:
50
+ - 价格触及下轨 → 买入
51
+ - 价格触及上轨 → 卖出
52
+ - 中轨作为止损参考
53
+
54
+ ## 动量策略
55
+
56
+ ### 动量因子
57
+ - **定义**: 过去N日收益率
58
+ - **信号**: 买入动量最强, 卖出动量最弱
59
+ - **周期**: 1-12个月
60
+
61
+ ### 相对强弱策略
62
+ - **计算**: 个股收益 - 市场收益
63
+ - **信号**: 相对强弱高于阈值 → 买入
64
+
65
+ ## 套利策略
66
+
67
+ ### 跨期套利
68
+ - **标的**: 期货不同到期合约
69
+ - **信号**: 价差偏离历史均值 → 买入低, 卖出高
70
+
71
+ ### 跨市场套利
72
+ - **标的**: 同一资产不同市场
73
+ - **标的**: A/H股, ETF/成分股
74
+
75
+ ### 期现套利
76
+ - **标的**: 期货 vs 现货指数
77
+ - **信号**: 基差 > 持有成本 → 买入期货
78
+
79
+ ## 事件驱动策略
80
+
81
+ ### 美股财报交易
82
+ - **方法**:
83
+ - 财报前: 隐含波动率高, 卖出期权
84
+ - 财报后: 方向确定后买入
85
+ - **风险**: 财报意外
86
+
87
+ ### 宏观事件策略
88
+ - **事件**: 央行会议, GDP发布, 非农
89
+ - **方法**: 事件前减仓, 事件后顺势
90
+
91
+ ## 风控原则
92
+
93
+ ### 仓位管理
94
+ | 方法 | 描述 | 适用场景 |
95
+ |------|------|----------|
96
+ | 固定仓位 | 每笔固定金额 | 趋势跟踪 |
97
+ | 等权仓位 | 各标的等权重 | 多策略 |
98
+ | 风险平价 | 按波动率倒数分配 | 组合投资 |
99
+ | 凯利公式 | f = (bp-q)/b | 优势明显时 |
100
+
101
+ ### 止损方法
102
+ | 方法 | 描述 | 参数 |
103
+ |------|------|------|
104
+ | 固定止损 | 价格跌破固定比例 | 5%-10% |
105
+ | 跟踪止损 | 最高点回落固定比例 | 5%-20% |
106
+ | 时间止损 | 持仓超过N天 | 5-20日 |
107
+ | 波动率止损 | ATR倍数止损 | 2-3倍ATR |
108
+
109
+ ### 风险指标
110
+ - **最大回撤**: 组合历史最大亏损
111
+ - **夏普比率**: (收益-无风险)/波动率
112
+ - **卡玛比率**: 年化收益/最大回撤
113
+ - **胜率**: 盈利交易占比
114
+ - **盈亏比**: 平均盈利/平均亏损
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "erlangshen",
3
+ "version": "0.1.0",
4
+ "description": "二郎神 - 全知全能的AI投资智能体",
5
+ "keywords": [
6
+ "investment",
7
+ "ai-agent",
8
+ "finance",
9
+ "trading",
10
+ "macro",
11
+ "portfolio"
12
+ ],
13
+ "author": "xiaoerdata",
14
+ "license": "MIT",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://github.com/xiaoerdata/xiaoer-erlangshen.git"
18
+ },
19
+ "homepage": "https://github.com/xiaoerdata/xiaoer-erlangshen",
20
+ "engines": {
21
+ "node": ">=16.0.0",
22
+ "python": ">=3.9"
23
+ },
24
+ "bin": {
25
+ "erlangshen": "./bin/cli.js"
26
+ },
27
+ "scripts": {
28
+ "postinstall": "node scripts/postinstall.js",
29
+ "preuninstall": "node scripts/preuninstall.js"
30
+ },
31
+ "os": [
32
+ "darwin",
33
+ "linux",
34
+ "win32"
35
+ ],
36
+ "dependencies": {
37
+ "chalk": "^4.1.2",
38
+ "ora": "^5.4.1",
39
+ "prompts": "^2.4.2",
40
+ "boxen": "^5.1.2"
41
+ }
42
+ }
@@ -0,0 +1,14 @@
1
+ openai>=1.0.0
2
+ pydantic>=2.0.0
3
+ psycopg2-binary>=2.9.0
4
+ lark-oapi>=1.0.0
5
+ rich>=13.0.0
6
+ aiohttp>=3.9.0
7
+ asyncio
8
+ beautifulsoup4>=4.12.0
9
+ lxml>=4.9.0
10
+ loguru>=0.7.0
11
+ python-dateutil>=2.8.0
12
+ httpx>=0.25.0
13
+ fastapi>=0.104.0
14
+ uvicorn>=0.24.0
@@ -0,0 +1,188 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * postinstall.js - npm 安装后脚本
5
+ * 自动安装 Python 依赖
6
+ */
7
+
8
+ const { spawn, execSync } = require('child_process');
9
+ const fs = require('fs');
10
+ const path = require('path');
11
+ const os = require('os');
12
+
13
+ const installDir = path.dirname(require.main.filename);
14
+ const projectRoot = installDir;
15
+
16
+ console.log('📦 二郎神安装中...');
17
+ console.log(` 安装目录: ${installDir}`);
18
+
19
+ // 检查 Python 版本
20
+ function checkPython() {
21
+ console.log('\n🔍 检查 Python 环境...');
22
+
23
+ try {
24
+ const python = os.platform() === 'win32' ? 'python' : 'python3';
25
+ const version = execSync(`${python} --version`, { encoding: 'utf-8' }).trim();
26
+ console.log(` ✓ ${version}`);
27
+
28
+ // 检查版本号
29
+ const match = version.match(/Python (\d+)\.(\d+)/);
30
+ if (match) {
31
+ const major = parseInt(match[1]);
32
+ const minor = parseInt(match[2]);
33
+
34
+ if (major < 3 || (major === 3 && minor < 9)) {
35
+ console.error(' ✗ Python 3.9+ required');
36
+ process.exit(1);
37
+ }
38
+ }
39
+
40
+ return python;
41
+ } catch (e) {
42
+ console.error(' ✗ Python 未安装');
43
+ console.error('\n请先安装 Python 3.9+:');
44
+ console.error(' macOS: brew install python3');
45
+ console.error(' Linux: sudo apt install python3 python3-pip');
46
+ console.error(' Windows: https://www.python.org/downloads/');
47
+ process.exit(1);
48
+ }
49
+ }
50
+
51
+ // 安装 Python 依赖
52
+ function installDependencies(python) {
53
+ console.log('\n📚 安装 Python 依赖...');
54
+
55
+ const requirementsPath = path.join(projectRoot, 'requirements.txt');
56
+
57
+ if (!fs.existsSync(requirementsPath)) {
58
+ console.log(' ⚠ requirements.txt not found, skipping');
59
+ return;
60
+ }
61
+
62
+ return new Promise((resolve, reject) => {
63
+ const pip = os.platform() === 'win32' ? 'pip' : 'pip3';
64
+
65
+ // 使用 pip install -r requirements.txt
66
+ const proc = spawn(python, ['-m', pip, 'install', '-r', requirementsPath, '--quiet'], {
67
+ stdio: 'inherit',
68
+ cwd: projectRoot
69
+ });
70
+
71
+ proc.on('close', (code) => {
72
+ if (code === 0) {
73
+ console.log(' ✓ 依赖安装完成');
74
+ resolve();
75
+ } else {
76
+ console.error(' ✗ 依赖安装失败');
77
+ reject(new Error(`pip exited with code ${code}`));
78
+ }
79
+ });
80
+
81
+ proc.on('error', reject);
82
+ });
83
+ }
84
+
85
+ // 创建配置目录
86
+ function createConfigDir() {
87
+ console.log('\n⚙️ 初始化配置目录...');
88
+
89
+ const configDir = os.homedir();
90
+ const erlangshenDir = path.join(configDir, '.erlangshen');
91
+
92
+ if (!fs.existsSync(erlangshenDir)) {
93
+ fs.mkdirSync(erlangshenDir, { recursive: true });
94
+ console.log(` ✓ 创建配置目录: ${erlangshenDir}`);
95
+ } else {
96
+ console.log(` ✓ 配置目录已存在: ${erlangshenDir}`);
97
+ }
98
+
99
+ // 创建示例配置
100
+ const configPath = path.join(erlangshenDir, 'config.toml');
101
+ if (!fs.existsSync(configPath)) {
102
+ const configTemplate = `# 二郎神配置文件
103
+ # https://github.com/xiaoerdata/xiaoer-erlangshen
104
+
105
+ # DeepSeek API Key (必需)
106
+ deepseek_api_key = ""
107
+
108
+ # 数据库配置 (可选,用于连接远程行情数据库)
109
+ [database]
110
+ host = ""
111
+ port = 3306
112
+ user = ""
113
+ password = ""
114
+
115
+ # 飞书配置 (可选,用于消息推送)
116
+ [feishu]
117
+ app_id = ""
118
+ app_secret = ""
119
+
120
+ # 代理配置 (可选)
121
+ [proxy]
122
+ enabled = false
123
+ http = ""
124
+ https = ""
125
+ `;
126
+
127
+ fs.writeFileSync(configPath, configTemplate);
128
+ console.log(` ✓ 创建配置文件: ${configPath}`);
129
+ }
130
+ }
131
+
132
+ // 验证安装
133
+ function verifyInstall(python) {
134
+ console.log('\n✅ 验证安装...');
135
+
136
+ try {
137
+ // 测试导入二郎神
138
+ const testCode = `
139
+ import sys
140
+ sys.path.insert(0, '${projectRoot.replace(/\\/g, '\\\\')}')
141
+ from src.core.brain import Brain
142
+ from src.core.investment_universe import get_universe
143
+ print('ok')
144
+ `;
145
+
146
+ const result = execSync(python, ['-c', testCode], { encoding: 'utf-8' }).trim();
147
+
148
+ if (result === 'ok') {
149
+ console.log(' ✓ 二郎神验证通过');
150
+ return true;
151
+ }
152
+ } catch (e) {
153
+ console.log(' ⚠ 验证时出现警告 (可能缺少 API Key)');
154
+ }
155
+
156
+ return false;
157
+ }
158
+
159
+ // 主函数
160
+ async function main() {
161
+ console.log('\n========================================');
162
+ console.log(' 二郎神 v0.1.0 - AI投资智能体');
163
+ console.log(' https://github.com/xiaoerdata/xiaoer-erlangshen');
164
+ console.log('========================================\n');
165
+
166
+ try {
167
+ const python = checkPython();
168
+ await installDependencies(python);
169
+ createConfigDir();
170
+ verifyInstall(python);
171
+
172
+ console.log('\n========================================');
173
+ console.log(' ✓ 安装完成!');
174
+ console.log('========================================');
175
+ console.log('\n📖 使用方法:');
176
+ console.log(' erlangshen --cli # 启动CLI');
177
+ console.log(' erlangshen --api # 启动API服务');
178
+ console.log('\n⚠️ 首次使用请配置 API Key:');
179
+ console.log(' vim ~/.erlangshen/config.toml');
180
+ console.log('');
181
+
182
+ } catch (e) {
183
+ console.error('\n❌ 安装失败:', e.message);
184
+ process.exit(1);
185
+ }
186
+ }
187
+
188
+ main();
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * preuninstall.js - npm 卸载前脚本
5
+ * 清理配置(可选)
6
+ */
7
+
8
+ const fs = require('fs');
9
+ const path = require('path');
10
+ const os = require('os');
11
+
12
+ const configDir = path.join(os.homedir(), '.erlangshen');
13
+
14
+ console.log('\n🧹 二郎神卸载中...');
15
+
16
+ // 检查是否要保留配置
17
+ if (process.env.ERLANG_SHEN_KEEP_CONFIG !== 'false') {
18
+ console.log('\n⚠️ 配置目录保留在:', configDir);
19
+ console.log(' 如需完全删除,请运行: rm -rf ~/.erlangshen');
20
+ }
21
+
22
+ console.log('\n👋 感谢使用二郎神,期待再见!\n');
@@ -0,0 +1,4 @@
1
+ """
2
+ 二郎神 - 投资分析智能体
3
+ """
4
+ __version__ = "0.1.0"
@@ -0,0 +1,3 @@
1
+ """
2
+ Agents 模块
3
+ """
@@ -0,0 +1,103 @@
1
+ """
2
+ 基础 Agent 类
3
+ """
4
+
5
+ from abc import ABC, abstractmethod
6
+ from typing import Any, Dict, Optional
7
+ from src.brain import Brain
8
+ from src.mcp.registry import MCPRegistry
9
+
10
+
11
+ class BaseAgent(ABC):
12
+ """
13
+ 基础 Agent 抽象类
14
+
15
+ 所有专业 Agent 的基类
16
+ """
17
+
18
+ def __init__(self, brain: Brain, mcp: MCPRegistry):
19
+ self.brain = brain
20
+ self.mcp = mcp
21
+ self.name = self.__class__.__name__
22
+ self.role = "分析师"
23
+ self.system_prompt = self._build_system_prompt()
24
+
25
+ @abstractmethod
26
+ def _build_system_prompt(self) -> str:
27
+ """构建系统提示"""
28
+ pass
29
+
30
+ @abstractmethod
31
+ async def process(self, query: str, **kwargs) -> str:
32
+ """
33
+ 处理查询
34
+
35
+ Args:
36
+ query: 用户查询
37
+ **kwargs: 其他参数
38
+
39
+ Returns:
40
+ 处理结果
41
+ """
42
+ pass
43
+
44
+ async def think(
45
+ self,
46
+ prompt: str,
47
+ temperature: Optional[float] = None
48
+ ) -> str:
49
+ """
50
+ 统一思考接口
51
+
52
+ Args:
53
+ prompt: 思考提示
54
+ temperature: 温度参数
55
+
56
+ Returns:
57
+ 思考结果
58
+ """
59
+ return await self.brain.think(
60
+ prompt=prompt,
61
+ system=self.system_prompt,
62
+ temperature=temperature
63
+ )
64
+
65
+ async def analyze(
66
+ self,
67
+ query: str,
68
+ framework: Optional[str] = None,
69
+ data: Optional[Dict[str, Any]] = None
70
+ ) -> str:
71
+ """
72
+ 统一分析接口
73
+
74
+ Args:
75
+ query: 分析查询
76
+ framework: 分析框架
77
+ data: 相关数据
78
+
79
+ Returns:
80
+ 分析结果
81
+ """
82
+ return await self.brain.analyze(
83
+ query=query,
84
+ framework=framework,
85
+ data=data
86
+ )
87
+
88
+ async def call_mcp_tool(self, tool_name: str, **kwargs) -> Any:
89
+ """
90
+ 调用 MCP 工具
91
+
92
+ Args:
93
+ tool_name: 工具名称
94
+ **kwargs: 工具参数
95
+
96
+ Returns:
97
+ 工具执行结果
98
+ """
99
+ return await self.mcp.call_tool(tool_name, **kwargs)
100
+
101
+ def get_available_tools(self) -> list:
102
+ """获取可用工具列表"""
103
+ return self.mcp.list_tools()
@@ -0,0 +1,86 @@
1
+ """
2
+ Base Agent - 基础智能体
3
+ 所有智能体的基类
4
+ """
5
+ from abc import ABC, abstractmethod
6
+ from typing import Optional, Any
7
+ from loguru import logger
8
+
9
+
10
+ class BaseAgent(ABC):
11
+ """
12
+ 基础智能体抽象类
13
+
14
+ 提供:
15
+ - 名称和描述
16
+ - 工具绑定
17
+ - 消息处理
18
+ - 日志记录
19
+ """
20
+
21
+ def __init__(
22
+ self,
23
+ name: str,
24
+ description: str = "",
25
+ tools: Optional[dict[str, Any]] = None,
26
+ ):
27
+ self.name = name
28
+ self.description = description
29
+ self.tools = tools or {}
30
+ logger.info(f"Agent '{name}' initialized")
31
+
32
+ def bind_tool(self, name: str, tool: Any) -> None:
33
+ """绑定工具"""
34
+ self.tools[name] = tool
35
+
36
+ async def call_tool(self, name: str, **kwargs) -> Any:
37
+ """调用工具 - 支持 dotted 格式如 'market_tools.get_stock_price'"""
38
+ # 支持 dotted 格式:tool_instance.method_name
39
+ if "." in name:
40
+ parts = name.split(".", 1)
41
+ tool_key = parts[0]
42
+ method_name = parts[1]
43
+
44
+ if tool_key not in self.tools:
45
+ return {"error": f"Tool '{tool_key}' not found"}
46
+
47
+ tool = self.tools[tool_key]
48
+ method = getattr(tool, method_name, None)
49
+ if method is None:
50
+ return {"error": f"Method '{method_name}' not found on tool '{tool_key}'"}
51
+ if callable(method):
52
+ return await method(**kwargs)
53
+ return {"error": f"Method '{method_name}' on '{tool_key}' is not callable"}
54
+
55
+ # 直接格式
56
+ if name not in self.tools:
57
+ return {"error": f"Tool '{name}' not found"}
58
+
59
+ tool = self.tools[name]
60
+ if hasattr(tool, "execute"):
61
+ return await tool.execute(**kwargs)
62
+ elif callable(tool):
63
+ return await tool(**kwargs)
64
+ return {"error": f"Tool '{name}' is not callable"}
65
+
66
+ @abstractmethod
67
+ async def process(self, query: str, context: Optional[dict] = None) -> dict:
68
+ """
69
+ 处理查询 - 子类必须实现
70
+
71
+ Args:
72
+ query: 输入查询
73
+ context: 上下文
74
+
75
+ Returns:
76
+ dict 处理结果
77
+ """
78
+ pass
79
+
80
+ def get_info(self) -> dict:
81
+ """获取智能体信息"""
82
+ return {
83
+ "name": self.name,
84
+ "description": self.description,
85
+ "tools": list(self.tools.keys()),
86
+ }