一个专业的咨询顾问 AI Agent,支持文档分析、联网搜索、报告生成
Project description
Consultant Agent 🤖
一个专业的咨询顾问 AI Agent,一行命令安装,开箱即用。
✨ 特性
- 🔍 联网搜索 - 实时获取最新信息
- 📄 文档阅读 - 支持 PDF、Word、Excel、PPT
- 📊 数据分析 - Excel 数据处理与分析
- 📝 内容生成 - 报告大纲、竞品对比、内容总结
- 🛠️ 易于集成 - 可作为工具嵌入其他 Agent
- 💾 对话记忆 - 自动保存上下文
🚀 快速开始
安装
pip install consultant-agent
设置 API Key
# Linux/Mac
export DEEPSEEK_API_KEY="sk-your-api-key"
# Windows
set DEEPSEEK_API_KEY=sk-your-api-key
💡 去 DeepSeek 开放平台 获取 API Key
使用
命令行交互
consultant
单次提问
consultant ask "北京今天天气怎么样"
consultant ask "帮我生成一个 AI Agent 技术发展的报告大纲"
Python 代码
from consultant_agent import ConsultantAgent
agent = ConsultantAgent()
reply = agent.ask("分析一下新能源汽车行业趋势")
print(reply)
📖 功能详解
命令行命令
| 命令 | 说明 | 示例 |
|---|---|---|
consultant |
交互式对话 | - |
consultant ask "问题" |
单次提问 | consultant ask "上海天气" |
consultant clear |
清空记忆 | - |
Python API
from consultant_agent import ConsultantAgent
# 基础用法
agent = ConsultantAgent()
reply = agent.ask("你的问题")
# 自定义配置
agent = ConsultantAgent(
api_key="sk-xxx", # 可选,默认从环境变量读取
model="deepseek-chat", # 模型名称
temperature=0, # 温度参数
enable_memory=True, # 启用记忆
)
# 清空记忆
agent.clear_memory()
作为工具嵌入其他 Agent
from consultant_agent import ConsultantAgent
from langgraph.prebuilt import create_react_agent
# 创建咨询顾问
consultant = ConsultantAgent()
# 转换为工具
consultant_tool = consultant.as_tool()
# 在你的 Agent 中使用
your_agent = create_react_agent(
your_llm,
tools=[consultant_tool, your_other_tools...]
)
🎯 支持的功能
| 功能 | 说明 | 示例 |
|---|---|---|
| 天气查询 | 全球城市天气 | "北京天气" |
| 数学计算 | 表达式计算 | "计算 123 * 456" |
| 联网搜索 | DuckDuckGo 搜索 | "搜索 AI Agent 最新进展" |
| 网页抓取 | 读取网页内容 | "读取 https://example.com" |
| PDF 阅读 | 提取 PDF 文字 | "读取 report.pdf" |
| Word 阅读 | 读取 docx 文档 | "读取 document.docx" |
| Excel 阅读 | 读取表格数据 | "读取 data.xlsx" |
| PPT 阅读 | 提取幻灯片文字 | "读取 slides.pptx" |
| 内容总结 | 多种总结风格 | "总结这篇文章" |
| 报告大纲 | 生成专业大纲 | "生成 XX 报告大纲" |
| 竞品对比 | 多维度对比表 | "对比 A、B、C 产品" |
| 案例搜索 | 查找行业案例 | "搜索数字化转型案例" |
⚙️ 环境变量
| 变量 | 必须 | 说明 |
|---|---|---|
DEEPSEEK_API_KEY |
✅ | DeepSeek API Key |
📦 可选依赖
# OCR 功能(识别图片/PDF 中的文字)
pip install consultant-agent[ocr]
# Web 界面
pip install consultant-agent[web]
# 完整安装
pip install consultant-agent[ocr,web]
🤝 贡献
欢迎 Issue 和 PR!
📄 许可证
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.1.0.tar.gz
(12.1 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.1.0.tar.gz.
File metadata
- Download URL: consultant_agent-0.1.0.tar.gz
- Upload date:
- Size: 12.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e246b7e6b74af646c44c53c963739ebe27cb8e7a516ad722041662600216f65c
|
|
| MD5 |
7806e40b86d5cd7ca4e394e22b9df8f3
|
|
| BLAKE2b-256 |
46f5e6b3d94bc99a647a0169247cf19832826e479bf1db147c0ffecc14ab7d65
|
File details
Details for the file consultant_agent-0.1.0-py3-none-any.whl.
File metadata
- Download URL: consultant_agent-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.6 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 |
4f0b567370c7ece27cc07e9f0df3c063c90f6204693cd3a4f18395e4da6dec80
|
|
| MD5 |
c17590127d5426724b783e161fc576e7
|
|
| BLAKE2b-256 |
e92b4ce976fefbca7390bed27bc723a0da5e2dfffe490a895e0951273ce71daf
|