feat: cost warning
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
Research direction
Start by tracing the existing cost calculation and warning flow for the --file option when a query is supplied as a CLI parameter. The work is done when exceeding the context-cost threshold prompts for confirmation before the API call, using token count when cost is unavailable.
Written by the indexing model from the issue text.
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.
# 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.
- Dominant language
- TypeScript
- Stars
- 46
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from callstack/ai-cli
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Project Roadmap Open
callstack/ai-cli#2 · 1 comment · 3 reactions · 2 assignees ·
All issues in callstack/ai-cli
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
ontola/atomic-server#1625 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
melgarafael/DeskcommCRM#1451 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
bug via-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bot:ai-assisted component:compact-js status:untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
midnightntwrk/midnight-sdk#403 ·