pi-web
pi-web copied to clipboard
bug:会话重命名标题报错
报错提示
No default stream function configured. Pass streamFn explicitly or call setDefaultStreamFn().
让pi自己分析了一把结论如下
点击 Generate title 时,pi-web 会走接口:
POST /api/sessions/[id]/auto-name
它会新建一个临时 Agent 来给会话起名。问题在于:
代码传的是:streamFunction: agent.streamFunction 但 Agent 构造函数读的是:options.streamFn 字段名对不上,streamFn 实际是空的 于是落到 getDefaultStreamFn(),再抛出:
No default stream function configured. Pass streamFn explicitly or call setDefaultStreamFn().
后让pi自己修复了下
做了什么 修改了本机 [email protected] 的 auto-name 路由:
文件: .../node_modules/@agegr/pi-web/.next/server/app/api/sessions/[id]/auto-name/route.js 改动: streamFunction: b.streamFunction → streamFn: b.streamFunction
经过我测试可以重新命名标题
fixed in adc919214bdd073a75369b979943a42de82b93a7