招标文件智能生成Agent【附带源码】

面向AI项目招标场景的智能文件撰写系统,7个Agent串行流水线协作,自动生成完整招标文件。
系统架构
用户输入 → [需求解析] → [招标公告] → [技术需求书] → [投标文件格式] → [评审办法] → [合同草案] → [汇总整合] → 完整招标文件
Agent清单
|
|
|
|
|
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
快速开始
1. 安装依赖
pip install requests
2. 运行
# 默认使用百度千帆LLM
python3 main.py "某省政务服务平台大模型智能问答系统建设项目,预算500万元,要求支持政务领域知识图谱,响应时间不超过2秒,并发用户数不低于1000,项目周期12个月,知识产权归采购方所有"
# 切换到本地Ollama
python3 main.py --ollama "某省政务服务平台大模型智能问答系统建设项目,预算500万元,要求支持政务领域知识图谱,响应时间不超过2秒,并发用户数不低于1000,项目周期12个月,知识产权归采购方所有"
# 从文件读取需求描述
python3 main.py --file requirements.txt
python3 main.py --file 'docs/requirements.pdf'
# 查看帮助
python3 main.py help
3. 输出
所有输出保存在 output/ 目录:
|
|
|
|---|---|
bidding_document.md |
|
bidding_document.html |
|
structured_requirements.json |
|
01_招标公告.md
05_合同草案.md |
|
execution_stats.json |
|
配置
环境变量
# LLM后端选择
export LLM_PROVIDER=qianfan # qianfan 或 ollama
# 千帆API
export QIANFAN_API_KEY=your_api_key
export QIANFAN_MODEL=ernie-x1-turbo-32k
# Ollama
export OLLAMA_BASE_URL=http://localhost:11434
export OLLAMA_MODEL=qwen2.5:7b
配置文件
修改 config.py 中的默认值。
项目结构
bidding-doc-generator/
├── main.py # 主入口
├── config.py # 全局配置
├── core/
│ ├── llm_client.py # LLM调用(千帆+Ollama双后端)
│ ├── prompt_loader.py # 提示词加载器
│ ├── orchestrator.py # 串行流水线编排器
│ └── html_report.py # HTML报告生成器
├── agents/
│ ├── base_agent.py # Agent基类(提示词从MD加载)
│ ├── requirement_parser.py # 需求解析Agent
│ ├── announcement_writer.py # 招标公告Agent
│ ├── tech_spec_writer.py # 技术需求书Agent
│ ├── bid_format_writer.py # 投标文件格式Agent
│ ├── evaluation_writer.py # 评审办法Agent
│ ├── contract_writer.py # 合同草案Agent
│ └── integration_agent.py # 汇总整合Agent
├── prompt/ # 提示词目录(Markdown)
│ ├── requirement_parser.md
│ ├── announcement_writer.md
│ ├── tech_spec_writer.md
│ ├── bid_format_writer.md
│ ├── evaluation_writer.md
│ ├── contract_writer.md
│ └── integration_agent.md
├── output/ # 输出目录
└── docs/
└── design.md # 设计文档
提示词管理
各Agent的提示词以Markdown文件形式存储在 prompt/ 目录,Agent初始化时自动加载。修改提示词只需编辑对应MD文件,无需改动代码。
LLM后端
|
|
|
|
|
|---|---|---|---|
|
|
|
|
|
|
|
|
|
|
降级策略
每个Agent都内置规则引擎兜底模板,当LLM调用失败时自动降级,确保系统可用性。
通过网盘分享的文件:bidding-doc-generator.zip
链接: https://pan.baidu.com/s/1ViRUFwKe9qadzxs3WN3PyQ?pwd=n6k8 提取码: n6k8
–来自百度网盘超级会员v4的分享
夜雨聆风