community_usecase/stock-analysis/README-zh.md
简体中文 | English
<p> <p align="center"></p>
<p align="center">
<b face="雅黑">基于🦉OWL框架的股票分析的智能体</b>
<p>
基于 🦉OWL 框架的股票分析的智能体,通过对股票的分析,为用户提供股票的分析报告,包括股票的基本信息、股票的技术指标、股票的风险指标、股票的投资建议等。
<p align="center"> <b face="雅黑">Stock Analysis Agent 架构图</b>
# 克隆 GitHub 仓库
git clone https://github.com/camel-ai/owl.git
# 进入项目目录
cd owl
# 如果你还没有安装 uv,请先安装
pip install uv
# 创建虚拟环境并安装依赖
# 我们支持使用 Python 3.10、3.11、3.12
uv venv .venv --python=3.10
# 激活虚拟环境
# 对于 macOS/Linux
source .venv/bin/activate
# 对于 Windows
.venv\Scripts\activate
# 安装 CAMEL 及其所有依赖
uv pip install -e .
# 进入Stock Analysis Agent目录
cd community_usecase/stock-analysis
# 安装 SEC 工具
uv pip install sec-api
# 创建 .env 文件
touch .env
添加相关 API keys 到 .env 文件 (可以参考 .env.example 文件)
# DeepSeek API (https://platform.deepseek.com/api_keys)
DEEPSEEK_API_KEY='Your_Key'
DEEPSEEK_API_BASE_URL="https://api.deepseek.com/v1"
# ZHIPU API (https://bigmodel.cn/usercenter/proj-mgmt/apikeys)
ZHIPUAI_API_KEY='Your_Key'
ZHIPUAI_API_BASE_URL="https://open.bigmodel.cn/api/paas/v4/"
# SEC-API (https://sec-api.io/profile)
SEC_API_API_KEY='Your_Key'
# AgentOps API (https://app.agentops.ai/settings/billing)
AGENTOPS_API_KEY= 'Your_Key'
[!TIP] 项目使用 DeepSeek 作为 Stock Analysis Agent 的主模型,使用智谱的 GLM-4-Flash 作为 SEC Agent 的模型
python run.py --h
usage: run.py [-h] [--company COMPANY] [--use-agentops] [--rounds ROUNDS]
Stock Analysis Agent
options:
-h, --help show this help message and exit
--company COMPANY Company name to analyze
--use-agentops Enable AgentOps tracking
--rounds ROUNDS Maximum conversation rounds
python run.py --company Apple
# ./log 目录
Apple_chat_history.json #记录整个执行过程,包括对话记录和工具调用信息等
# ./output 目录
Apple_analysis_report.md #输出的投资分析报告
如果您在运行中发现问题,可以尝试以下方法:
stock-analysis
├── agent
│ └── sec_agent.py # SEC Agent
├── example
├── log # log directory
├── output # Report output directory
├── prompts.py # Prompt templates
├── run.py # Main file
└── tools
└── sec_tools.py # SEC Tool
本项目基于 CAMEL-AI OWL 框架构建,该框架许可是Apache License 2.0
-该项目基于CAMEL-AI OWL 框架构建 -特别感谢 CAMEL-AI 的贡献者
Finding the Scaling Law of Agents: The First and the Best Multi-Agent Framework.