feat: cost warning
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- typescript
调研方向
首先跟踪查询作为 CLI 参数提供时 --file 选项现有的成本计算和警告流程。当超出上下文成本阈值时,在 API 调用前请求确认,并在成本不可用时使用 token 数量,即表示工作完成。
由索引模型根据 Issue 内容生成。
描述
Is your feature request related to a problem? Please describe.
Currently there is a scenario when AI CLI can make expensive API call without user confirmation. This happens when user use --file option and asks a query in CLI params. In such case, even when the price threshold is exceeded and user gets a warning, he is not able to prevent this API call.
Describe the solution you'd like
In case file context is used, and user exceeds warning threshold for context and, and there is a query in CLI params: then CLI should ask user to confirm if it should make the API call before making it.
# ai -i --file file.md Some question
Using the provided file will increase conversation costs by $1.1193 per message.
Do you want to continue? [y/N]:
Describe alternatives you've considered
Warning as is, but there is a risk of making expensive API can which user would not want if he knew the costs.
Additional context
We should use current cost calculation features.
In rare case cost is not available, we should refer to token count.
- 主要语言
- TypeScript
- 星标
- 46
- 派生
- 2
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
callstack/ai-cli 的其他 Issue
-
难度 5/5 一周以上 新手友好度 25/100
-
Project Roadmap可能重新可做 @Q1w1N 于 970 天前认领,目前没有进行中的 PR。 未关闭
相似的 Issue
-
check:failed streams:add
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
type: bug
难度 2/5 1-3 小时 新手友好度 84/100
interledger/rafiki#3986 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
Doist/todoist-cli#576 ·
维护者通常 1 天内回复
-
feature
难度 1/5 1 小时以内 新手友好度 72/100
vercel-labs/skills#2370 ·
维护者通常 1 天内回复
-
🐛 Bug supabase/cli
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复