Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: cost warning #31

Open
mdjastrzebski opened this issue Mar 6, 2024 · 0 comments
Open

feat: cost warning #31

mdjastrzebski opened this issue Mar 6, 2024 · 0 comments

Comments

@mdjastrzebski
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant