长文供给寻找 agent

luojunhui f762466f52 Merge branch 'feature/luojunhui/20260325-add-cooperation-projec' of luojunhui/LongArticleSearchAgent into master hace 5 horas
src 1e467e80c2 标准化服务 hace 5 horas
tests 93131dc7b7 标准化服务 hace 5 horas
.dockerignore 65dd5492ef 标准化服务 hace 8 horas
.gitignore 65dd5492ef 标准化服务 hace 8 horas
Dockerfile 65dd5492ef 标准化服务 hace 8 horas
LICENSE 65dd5492ef 标准化服务 hace 8 horas
Makefile 65dd5492ef 标准化服务 hace 8 horas
README.md 65dd5492ef 标准化服务 hace 8 horas
app.py 65dd5492ef 标准化服务 hace 8 horas
pyproject.toml 1e467e80c2 标准化服务 hace 5 horas
requirements.txt 65dd5492ef 标准化服务 hace 8 horas
server.toml e4dab72880 server_init hace 21 horas

README.md

LongArticleSearchAgent

长文供给寻找 Agent

1. 项目结构

LongArticleSearchAgent/
├── app.py                                  # 应用入口
├── pyproject.toml                          # 项目元信息 & 工具配置
├── requirements.txt                        # Python 依赖
├── Makefile                                # 常用命令快捷方式
├── Dockerfile                              # 容器构建
├── .env.example                            # 环境变量模板
│
├── src/
│   ├── agent/                              # Agent 业务逻辑(待开发)
│   │
│   ├── config/                             # 配置层(Pydantic Settings)
│   │   ├── agent_config.py                 # 聚合配置入口
│   │   ├── api/
│   │   │   └── deepseek.py                 # DeepSeek LLM 配置
│   │   ├── aliyun/
│   │   │   └── log.py                      # 阿里云日志配置
│   │   └── database/
│   │       └── mysql_config.py             # MySQL 数据库配置
│   │
│   ├── core/                               # 核心层
│   │   ├── api/v1/                         # API 路由 & 端点
│   │   │   ├── endpoints/
│   │   │   │   └── health.py               # 健康检查端点
│   │   │   ├── middleware/
│   │   │   │   ├── error_handler.py        # 全局异常处理
│   │   │   │   └── response.py             # 统一响应构建器 R
│   │   │   ├── routes/
│   │   │   │   └── route.py                # 路由统一注册
│   │   │   └── utils/
│   │   │       └── deps.py                 # API 依赖容器
│   │   ├── bootstrap/
│   │   │   ├── logging_config.py           # 统一日志配置
│   │   │   └── resource_manager.py         # 应用生命周期管理
│   │   └── dependency/
│   │       └── dependencies.py             # DI 容器(dependency_injector)
│   │
│   └── infra/                              # 基础设施层
│       ├── database/
│       │   └── mysql/
│       │       └── async_mysql_pool.py     # 异步 MySQL 连接池
│       └── trace/
│           └── logging/
│               └── log_service.py          # 阿里云日志服务
│
└── tests/                                  # 测试
    ├── conftest.py                         # 公共 fixtures
    ├── unit/
    │   └── test_config.py
    └── integration/
        └── test_health.py

2. 快速开始

# 安装依赖
make install

# 复制环境变量模板并填写真实配置
cp .env.example .env

# 开发模式运行(热重载)
make dev

# 生产模式运行
make run

3. 常用命令

命令 说明
make install 安装 Python 依赖
make dev 开发模式启动(热重载)
make run 生产模式启动
make test 运行测试
make lint 代码检查
make format 代码格式化
make docker-build 构建 Docker 镜像
make docker-run 以 Docker 容器运行

4. 环境变量

参考 .env.example 查看所有需要配置的环境变量。

5. License

MIT