Commit Graph

55 Commits

Author SHA1 Message Date
panda 76f98a7aeb feat: add Anthropic API provider support and missing env vars
- Add LLM_PROVIDER env var (openai/anthropic) to switch cloud backend
- Use ChatAnthropic for anthropic provider with custom base_url
- Add CONTEXT_MAX_TOKENS, CONTEXT_KEEP_RECENT, SESSIONS_DIR,
  HISTORY_MAX_SNAPSHOTS to .env and .env.example
- Add langchain-anthropic dependency to requirements.txt

Note: E2E testing blocked — the configured MiniMax API key
(sk-cp-...) returns 401 across all endpoints (Anthropic and OpenAI).
The API key may be expired or lack text-generation model access.
2026-05-14 23:39:00 +08:00
panda d0f5d05316 docs: 项目说明 — 架构、快速开始、环境变量、项目结构
README.md 涵盖:
  功能概述、架构图(Streamlit→LangGraph→FastAPI)、前置要求、
  5步快速开始指南、使用示例、验证服务限制说明、项目结构、
  环境变量完整列表
2026-05-14 23:21:31 +08:00
panda e113374682 feat: Streamlit多轮对话界面 + 集成测试
app.py:
  侧边栏:会话管理(创建/切换/删除)、快捷操作(预览/撤销/重置)、
         配置信息、JRXML下载
  主区域:多轮聊天、8种意图差异化展示(JRXML代码/咨询回答/
          错误解释/成功提示)
  URL参数:?session_id= 会话分享

tests/:
  test_validation.py: 验证服务6个单元测试(健康检查/空内容/
                      无效XML/缺少尺寸/有效JRXML/字段引用)
  test_agent.py: 5个集成验收场景(简单生成/自动修正/
                  多轮修改/上下文感知修改/最大重试处理)
2026-05-14 23:21:22 +08:00
panda 4b43c5d3e4 feat: LangGraph工作流核心 — Agent状态/节点/图 + 验证服务 + 知识库
agent/
  state.py: AgentState TypedDict(20字段含意图/压缩/会话/撤销)
  nodes.py: 17个节点函数(生成/修改/验证/纠错/意图分类/压缩/撤销/重置)
  graph.py: 17节点状态图,8意图路由分发

验证服务 validation_service/
  main.py: FastAPI服务,lxml XSD验证 + 结构化检查(字段引用/SQL/尺寸)

数据 data/
  sample_templates/: 4个JRXML示例模板
  corrections/: 3个错误修正案例

脚本 scripts/
  init_kb.py: Chroma知识库初始化
2026-05-14 23:21:10 +08:00
panda 21a5fdf930 feat: 后端基础设施 — LLM工厂/Embedding工厂/验证客户端/会话持久化
- backend/llm.py: 支持 OpenAI 兼容 API 与 Ollama 本地模型切换
- backend/embeddings.py: 支持云端与本地嵌入模型(sentence-transformers)
- backend/validation.py: FastAPI 验证服务 HTTP 客户端
- backend/session.py: JSON 文件会话管理(创建/加载/保存/列表/删除)
- .env.example: 完整环境变量模板
- requirements.txt: 所有 Python 依赖声明
2026-05-14 23:20:56 +08:00