feat: cost warning
- Langage dominant
- TypeScript
- Étoiles
- 46
- Forks
- 2
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
**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.
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par suivre le flux existant de calcul des coûts et d'avertissement pour l'option --file lorsqu'une requête est fournie comme paramètre CLI. Le travail est terminé lorsque le dépassement du seuil de coût du contexte demande une confirmation avant l'appel à l'API, en utilisant le nombre de tokens lorsque le coût n'est pas disponible.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- typescript
- Domaine
- ai, cli
- Type d'issue
- Fonctionnalité
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100