AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

Report remaining budget to user

Open rob-luke opened this issue 2 years ago • 14 comments

Background

Closes #6 Following #762, this PR reports the remaining and total budget to the user.

Changes

Reports the budget to the user if the budget is set. The budget is report before "NEXT ACTIONS"

Documentation

Modified print_assistant_thoughts to report the remaining budget and the total budget.

Test Plan

Wrote tests. But you can also see the change in the figure below

image

Questions to reviewers

  • Is this too noisy? Would you prefer I make this only show if the user passes in a flag like python -m autogpt --report_budget?
  • I find it useful to also include the total budget. But if this is too noisy I can remove it
  • There were circular import issues. So the import is done in the function. Alternatively, I could make larger changes to the codebase, but this seemed the simplest change to make. Let me know if you want me to take another path.

PR Quality Checklist

  • [x] My pull request is atomic and focuses on a single change.
  • [x] I have thoroughly tested my changes with multiple different prompts.
  • [x] I have considered potential risks and mitigations for my changes.
  • [x] I have documented my changes clearly and comprehensively.
  • [x] I have not snuck in any "extra" small tweaks changes

rob-luke avatar Apr 26 '23 11:04 rob-luke

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 8, 2023 1:00am

vercel[bot] avatar Apr 26 '23 11:04 vercel[bot]

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.29 :warning:

Comparison is base (dc95959) 61.31% compared to head (61b09e8) 61.03%.

:exclamation: Current head 61b09e8 differs from pull request most recent head ebbeb48. Consider uploading reports for the commit ebbeb48 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3313      +/-   ##
==========================================
- Coverage   61.31%   61.03%   -0.29%     
==========================================
  Files          72       72              
  Lines        3304     3313       +9     
  Branches      542      543       +1     
==========================================
- Hits         2026     2022       -4     
- Misses       1141     1152      +11     
- Partials      137      139       +2     
Impacted Files Coverage Δ
autogpt/logs.py 84.02% <100.00%> (+0.89%) :arrow_up:

... and 2 files with indirect coverage changes

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

codecov[bot] avatar Apr 26 '23 11:04 codecov[bot]

FYI @Vwing

rob-luke avatar Apr 27 '23 08:04 rob-luke

Tests fail @rob-luke

Pwuts avatar Apr 27 '23 21:04 Pwuts

Tests fail @rob-luke

The tests started failing when you merged main. But I have fixed the issues. So this should be good for review @Pwuts @collijk @BillSchumacher

rob-luke avatar Apr 28 '23 12:04 rob-luke

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

github-actions[bot] avatar Apr 28 '23 18:04 github-actions[bot]

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

github-actions[bot] avatar Apr 28 '23 22:04 github-actions[bot]

I just fixed all the errors are #3436 was merged. Things should be good to review again @collijk

rob-luke avatar Apr 28 '23 23:04 rob-luke

Thanks @Vwing and @merwanehamadi I’m keeping this updated with main. Is there anyone I should ping for another review/merge?

rob-luke avatar May 04 '23 18:05 rob-luke

The failing test is unrelated to this change. I do not have access to restart the CI. When there is a push to main I will merge it in and that will restart the CI.

rob-luke avatar May 04 '23 23:05 rob-luke

This is a mass message from the AutoGPT core team. Our apologies for the ongoing delay in processing PRs. This is because we are re-architecting the AutoGPT core!

For more details (and for infor on joining our Discord), please refer to: https://github.com/Significant-Gravitas/Auto-GPT/wiki/Architecting

p-i- avatar May 05 '23 00:05 p-i-

Thanks for the info @p-i- I read the wiki and suggest this Pr comes under point 1 and should be merged before reintegration

rob-luke avatar May 05 '23 22:05 rob-luke

I [...] suggest this Pr comes under point 1 and should be merged before reintegration

I agree. This is a rather simple change but such a useful one. And while it's not as extensive as #3466, it solves the problem for most people for now. It may need to be revisited soonish to come up with a more generic implementation - but for now it's definitely candidate material to be considered for a review despite the ongoing re-arch effort.

Also, it's worth keeping in mind that this change is perfectly in line with all project recommendations to monitor API usage. So, definitely do consider this for integration now:

https://github.com/Significant-Gravitas/Auto-GPT#readme

Please note that the use of the GPT-4 language model can be expensive due to its token usage. By utilizing this project, you acknowledge that you are responsible for monitoring and managing your own token usage and the associated costs. It is highly recommended to check your OpenAI API usage regularly and set up any necessary limits or alerts to prevent unexpected charges.

Boostrix avatar May 06 '23 08:05 Boostrix

it seems, there's a dedicated budget manager implementation in progress: #3919

Boostrix avatar May 07 '23 06:05 Boostrix

Thanks for the info @Boostrix In that case I will close this PR. Thanks anyway @Vwing

rob-luke avatar May 08 '23 01:05 rob-luke

Would not close it yet. Your patch looks straightforward and should work for many folks "as is" while the other stuff still is in the pipeline and might take a couple of weeks before it really arrives in the form of a functional feature

Boostrix avatar May 08 '23 04:05 Boostrix