一个专业的咨询顾问 AI Agent,支持文档分析、联网搜索、报告生成
Project description
Consultant Agent
一个专业的咨询顾问 AI Agent,支持文档分析、联网搜索、报告生成。
功能特性
- 文档分析: 支持 PDF、Word、Excel、PowerPoint 文档解析
- 联网搜索: 使用 DuckDuckGo 搜索最新信息
- 报告生成: 基于模板自动生成专业分析报告
- 多 Agent 协作: 支持多 Agent 并行处理复杂任务
- Plan 模式: 支持分步骤规划和执行复杂任务
安装
pip install consultant-agent
安装可选依赖:
# Web 界面支持
pip install consultant-agent[web]
# OCR 支持
pip install consultant-agent[ocr]
# 开发依赖
pip install consultant-agent[dev]
快速开始
命令行使用
# 设置 API Key
export DEEPSEEK_API_KEY=your_api_key
# 运行单次查询
consultant-agent "帮我搜索一下最新的AI新闻"
# 交互模式
consultant-agent --interactive
Python API
from consultant_agent import create_agent, run_agent
# 创建 Agent
agent = create_agent()
# 运行查询
result = run_agent(agent, "帮我分析这份报告")
# 流式输出
run_agent(agent, "搜索最新新闻", stream=True)
使用工具
from consultant_agent.tools import register_all_tools, get_langchain_tools
# 注册所有工具
register_all_tools()
# 获取 LangChain 格式的工具
tools = get_langchain_tools()
# 自定义 Agent
from langchain_openai import ChatOpenAI
from langgraph.prebuilt import create_react_agent
llm = ChatOpenAI(model="gpt-4")
agent = create_react_agent(llm, tools)
支持的工具
| 工具 | 描述 |
|---|---|
read_file |
读取文件内容 |
write_file |
写入文件 |
edit_file |
编辑文件 |
list_files |
列出目录文件 |
run_command |
执行命令行命令 |
web_search |
联网搜索 |
read_url |
读取网页内容 |
read_pdf |
读取 PDF 文件 |
read_docx |
读取 Word 文档 |
read_excel |
读取 Excel 文件 |
analyze_excel |
分析 Excel 数据 |
read_pptx |
读取 PowerPoint |
summarize |
文本摘要 |
环境变量
| 变量 | 描述 | 默认值 |
|---|---|---|
DEEPSEEK_API_KEY |
DeepSeek API Key | - |
OPENAI_API_KEY |
OpenAI API Key (可选) | - |
版本历史
v0.2.0
- 修复 API Key 延迟初始化问题
- 优化包结构
- 添加 CLI 命令
v0.1.0
- 初始版本发布
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
consultant_agent-0.2.0.tar.gz
(58.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file consultant_agent-0.2.0.tar.gz.
File metadata
- Download URL: consultant_agent-0.2.0.tar.gz
- Upload date:
- Size: 58.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
79dac7ba323c2be4d89fd8aee158aad81279a16ea122952c1bb9c21c4b8d8fea
|
|
| MD5 |
c7060329ea9e58d3c1534694739f5681
|
|
| BLAKE2b-256 |
5d8c6bf71d5e17592430d4e8f05178beecc14a5c545dc7689f9779e632b477b7
|
File details
Details for the file consultant_agent-0.2.0-py3-none-any.whl.
File metadata
- Download URL: consultant_agent-0.2.0-py3-none-any.whl
- Upload date:
- Size: 71.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca040567463bac766e2ae0850678dafac9b50aa865deba925def365725cc28a5
|
|
| MD5 |
2e34413e292d6239f4ea919b4958caa6
|
|
| BLAKE2b-256 |
1c4a62d0e615631ffda7243769dbfb29eef142634d60fe95d3d5d0d86df8ba6b
|