model-auto-router-api #8
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
weisanju/pi-plugins#8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
pi 0.84 之后,
pi.registerProvider()的api字段必须是一个返回ProviderStreams的函数,不能是字符串。pi-model-auto-router 0.3.1 第 1090 行:
但这个字符串 API 从未注册,导致其他扩展(如 pi-lovely-rename、pi-powerline-footer 的 working-vibes)通过
ctx.modelRegistry.find()拿到模型后直接抛异常:复现步骤
影响范围
Phi.modelRegistry.getApiKeyAndHeaders()或streamSimple的扩展会失败(auto-rename、notify、working-vibes 等)auto-rename 提示错误如下: Warning: Auto-rename failed: No API provider registered for api: model-auto-router-api
更正:此前归因有误。
api: "model-auto-router-api"+streamSimple的用法是正确的——pi 0.81 起有意把扩展注册的 provider 移出 pi-ai 全局 compat API 表(见 pi-powerline-footer CHANGELOG 中对 #134 同类问题的修复说明)。真正的问题在调用方(如
@xl0/pi-lovely-rename):它直接调 pi-ai 全局completeSimple(model, ...),无法解析扩展注册的 provider,从而抛出No API provider registered for api: model-auto-router-api。正确的修法是调用方改用 modelRegistry 提供的 provider 感知解析路径,而不是改 auto-router。issue 中的「api 应为函数」建议是错误的,请忽略。关闭本 issue。