Skip to content

LLM seam 骨架:统一流式入口与协议适配器注册表 #593

Description

@AlphaCatMeow

背景

#591(golden 基线,PR #590)为 LLM 调用链锁定了五协议 wire payload 与传输装配快照。在该基线保护下,下一步是引入 LLM seam 骨架:把分散在 streamByApi.ts 的协议分发收敛为可注册的适配器结构,并建立统一流式入口,为后续供应商级重试策略、拦截器注册化与轨迹事件提供挂载点。

目标

  • 新增 lib/providers/service/:LlmAdapter 接口、api→adapter 注册表、统一入口 llm.stream()
  • pi-ai 四协议与 DeepSeek 原生协议以适配器形式承接现有实现(原样搬移,不重写)
  • streamByApi.ts 收缩为保留原签名的兼容壳;agentRunner / textOnlyRuntime 换用统一入口
  • 行为严格等价:golden 基线零修改通过;零 Rust 改动、零镜像文件改动

非目标

  • 重试/failover 策略变更(后续 PR)
  • 拦截器/中间件注册化(后续 PR)
  • 插件系统或动态加载

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions