* Add config as attribute to Agent, rename old config to ai_config
* Code review: Pass ai_config
---------
Co-authored-by: Nicholas Tindle <nick@ntindle.com>
Co-authored-by: merwanehamadi <merwanehamadi@gmail.com>
* feat: set max token limits for better user experience
* fix: use OPEN_AI_CHAT_MODELS max limits
* fix: use the old default of 8000
* fix: formatting so isort/black checks pass
* fix: avoid circular dependencies
* fix: use better to avoid circular imports
* feat: introduce soft limits and use them
* fix: circular import issue and missing field
* fix: move import to avoid overriding doc comment
* feat: DRY things up and set token limit for fast llm models too
* tests: make linter tests happy
* test: use the max token limits in config.py test
* fix: remove fast token limit from config
* feat: remove smart token limit from config
* fix: remove unused soft_token_limit var
* fix: remove unneeded tests, settings aren't in config anymore
---------
Co-authored-by: k-boikov <64261260+k-boikov@users.noreply.github.com>
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
* Fix issues with file reading and writing with Python code
* Change error message, use Workspace.get_path
---------
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
* Rearrange tests into unit/integration/challenge categories
* Fix linting + `tests.challenges` imports
* Fix obscured duplicate test in test_url_validation.py
* Move VCR conftest to tests.vcr
* Specify tests to run & their order (unit -> integration -> challenges) in CI
* Fail Docker CI when tests fail
* Fix import & linting errors in tests
* Fix `get_text_summary`
* Fix linting errors
* Clean up pytest args in CI
* Remove bogus tests from GoCodeo
* feat: pass config to call_ai_functions in coimmands
* feat: config for read_audio_from_file
* feat: file operations cfg
NOTE: we replaced the CFG in the command enable with TRUE b/c not sure how to handle this yet
* feat: git command conversion
* feat: google search
* feat: image generation
* feat: extract cfg from browser commands
* feat: remove cfg from execute code commands
* fix: file operation related tests
* fix: linting
* fix: tests for read_audio
* fix: test error
* feat: update cassettes
* fix: linting
* fix: test typechecking
* fix: google_search errors if unexpected kw arg is passed
* fix: pass config param to google search test
* fix: agent commands were broken + cassettes
* fix: agent test
* feat: cassettes
* feat: enable/disable logic for commands
* fix: some commands threw errors
* feat: fix tests
* Add new cassettes
* Add new cassettes
* ci: trigger ci
* Update autogpt/commands/execute_code.py
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
* fix prompt
* fix prompt + rebase
* add config remove useless imports
* put back CFG just for download file
* lint
* The signature should be mandatory in the decorator
* black isort
* fix: remove the CFG
* fix: non typed arg
* lint: type some args
* lint: add types for libraries
* Add new cassettes
* fix: windows compatibility
* fix: add config access to decorator
* fix: remove twitter mention
* DDGS search works at 3.0.2 version
* ci: linting
---------
Co-authored-by: Auto-GPT-Bot <github-bot@agpt.co>
Co-authored-by: merwanehamadi <merwanehamadi@gmail.com>
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
Co-authored-by: kinance <kinance@gmail.com>
* * there is really no need to return the reference to the Selenium driver along with the text summary and list of links.
* * removing unused second return value from browse_website()
* * updated cassette
* * updated YAML cassette for test_browse_website
* * after requirements reinstall, another update YAML cassette for test_browse_website
* * another update YAML cassette for test_browse_website, only as a placholder commit to trigger re-testing due to some docker TCP timeout issue
* * another update YAML cassette for test_browse_website
---------
Co-authored-by: batyu <batyu@localhost>
* integration tests in ci pipeline
* Update CONTRIBUTING.md
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
---------
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
* config.py: make load_dotenv(override=True)
* Update Python version and benchmark file in benchmark.yml
* Refactor main function and imports in cli.py
* Update import statement in ai_config.py
* Add set_temperature and set_memory_backend methods in config.py
* Remove unused import in prompt.py
* Add goal oriented tasks workflow
* Added agent_utils to create agent
* added pytest and vcrpy
* added write file cassette
* created goal oriented task write file with cassettes to not pay openai tokens
* solve conflicts
* add ability set azure because github workflow needs it off
* solve conflicts in cli.py
* black because linter fails
* solve conflict
* setup github action to v3
Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
* fix conflicts
Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
* Plugins: debug line always printed in plugin load
* add test for fix_json_using_multiple_techniques
* style
* style
* mocking try_ai_fix to avoid call_ai_function
* black style
* mock try_ai_fix to avoid calling the AI model
* removed mock, as we can add @requires_api_key("OPEN_API_KEY")
* style
* reverse merge conflict related files and changes
* bring back the mock for try_ai_fix
---------
Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
Co-authored-by: Merwane Hamadi <merwanehamadi@gmail.com>
Co-authored-by: Merwane Hamadi <merwane.hamadi@redica.com>
Co-authored-by: Richard Beales <rich@richbeales.net>
Co-authored-by: Nicholas Tindle <nick@ntindle.com>
Co-authored-by: BillSchumacher <34168009+BillSchumacher@users.noreply.github.com>
* Implemented running cost counter for chat completions
This data is known to the AI as additional system context, and is printed out to the user
* Added comments to api_manager.py
* Added user-defined API budget.
The user is now prompted if they want to give the AI a budget for API calls. If they enter nothing, there is no monetary limit, but if they define a budget then the AI will be told to shut down gracefully once it has come within 1 cent of its limit, and to shut down immediately once it has exceeded its limit. If a budget is defined, Auto-GPT is always aware of how much it was given and how much remains to be spent.
* Chat completion calls are now done through api_manager. Total running cost is printed.
* Implemented api budget setting and tracking
User can now configure a maximum api budget, and the AI is aware of that and its remaining budget. The AI is instructed to shut down when exceeding the budget.
* Update autogpt/api_manager.py
Change "per token" to "per 1000 tokens" in a comment on the api cost
Co-authored-by: Rob Luke <code@robertluke.net>
* Fixed lint errors
* Include embedding costs
* Add embedding completion cost
* lint
* Added 'requires_api_key' decorator to test_commands.py, switched to a valid chat completions model
* Refactor API manager, add debug mode, and add tests
- Extract model costs to to avoid duplication
- Add debug mode parameter to ApiManager class
- Move debug mode configuration to
- Log AI response and budget messages in debug mode
- Implement 'test_api_manager.py'
* Fixed test_setup failing. An extra user input is needed for api budget
* Linting
---------
Co-authored-by: Rob Luke <code@robertluke.net>
Co-authored-by: Nicholas Tindle <nick@ntindle.com>
* Add workspace abstraction
* Remove old workspace implementation
* Extract path resolution to a helper function
* Add api key requirements to new tests
* Add automatic ai prompting
* Tweak the default prompt.
* Print agent info upon creation.
* Improve system prompt
* Switch to fast_llm_model by default
* Add format output command to user prompt.
This vastly improves formatting success rate.
* Add fallback to manual mode if llm output cannot be parsed (or other error).
* Add unit test to cover ai creation setup.
* Replace redundent prompt with manual mode instructions.
* Add missing docstrings and typing.
* Runs black on changes.
* Runs isort
* Update Python version and benchmark file in benchmark.yml
* Refactor main function and imports in cli.py
* Update import statement in ai_config.py
* Add set_temperature and set_memory_backend methods in config.py
* Remove unused import in prompt.py
* Add goal oriented tasks workflow
* Added agent_utils to create agent
* added pytest and vcrpy
* added write file cassette
* created goal oriented task write file with cassettes to not pay openai tokens
* solve conflicts
* add ability set azure because github workflow needs it off
* solve conflicts in cli.py
* black because linter fails
* solve conflict
* setup github action to v3
Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
* fix conflicts
Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
* Plugins: debug line always printed in plugin load
* add decorator to tests
Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
* move decorator higher up
Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
* merge
---------
Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
Co-authored-by: Merwane Hamadi <merwanehamadi@gmail.com>
Co-authored-by: Merwane Hamadi <merwane.hamadi@redica.com>
Co-authored-by: Richard Beales <rich@richbeales.net>
Co-authored-by: Nicholas Tindle <nick@ntindle.com>
Co-authored-by: BillSchumacher <34168009+BillSchumacher@users.noreply.github.com>