callstack / callstack/ai-cli

feat: cost warning

オープン
#31 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
TypeScript
スター
46
フォーク
2
PR マージ指標
30日以内にマージされた PR はありません

説明

**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.

```shell-session
# 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.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。