Skip to content

feat(intelligence): 实现 Qwen LLM 与 Agent Function Calling - #195

Merged
Wintercom merged 7 commits into
1024XEngineer:mainfrom
yyy-router:feature/intelligence-agent
Aug 11, 2026
Merged

Wintercom merged 7 commits into
1024XEngineer:mainfrom
yyy-router:feature/intelligence-agent

Conversation

@yyy-router

Copy link
Copy Markdown
Contributor

依赖关系

Part of #183

变更概述

  • 增加供应商无关的流式 LLM 契约
  • 增加阿里云 OpenAI-compatible Qwen 异步流式适配器
  • 增加 OpenAI-compatible LLM 配置、依赖和安全错误转换
  • 增加五个日程工具的产品契约 Schema 与业务命令映射
  • 通过注入的 ScheduleAgentService 和 account_id 串联 Agent 与业务边界
  • 增加 request_user_input 结构化反问、暂停与跨轮恢复
  • 增加串行 Function Calling、多轮工具调用和轮数限制
  • 工具调用轮次的中间文本不作为可播报 AgentTextDelta 暴露,为后续 TTS 保留安全事件边界

范围限制

  • 不包含 ASR 到 Agent 的组合管线
  • 不包含 TTS、文本句段切分或音频输出
  • 不包含 FastAPI WebSocket Endpoint 和客户端协议
  • 不包含真实地图 Provider 和真实数据库 Service 实现
  • 日程工具通过现有 ScheduleAgentService 接口调用;具体持久化实现由业务模块负责
  • 不包含会话持久化、全局会话表或同一会话并发保护

验证

  • 后端完整质量门禁通过
  • 166 passed,17 skipped
  • 覆盖率 90.86%
  • uv.lock --check 通过
  • Alembic head:20260810_0005
  • 真实 Qwen 普通流式文本冒烟测试通过
  • 真实 Qwen Function Calling 输出冒烟测试通过

审查重点

  • Tool Call 参数必须在流结束后聚合并解析
  • 工具调用轮次的中间文本不会被下游 TTS 误播
  • 账号上下文由服务端注入,不由模型生成
  • 地点默认搜索范围不暴露给 Agent,由工具/基础设施层处理
  • 业务工具结果和错误必须如实回传,不能伪造成功

@vercel

vercel Bot commented Aug 11, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
timeflow Ready Ready Preview Aug 11, 2026 7:32am

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found one correctness issue affecting multi-turn conversations. The targeted tests could not be run because uv and pytest are not installed in the review environment.

Comment thread backend/src/timeflow/intelligence/conversation/agent.py

@Wintercom Wintercom left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@Wintercom
Wintercom merged commit d5e44b8 into 1024XEngineer:main Aug 11, 2026
5 checks passed

This branch was successfully deployed

1 active deployment
Preview — f0fa6208 Deployed Aug 11, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants