Commit Graph

159 Commits (40a75c804ccfe7dec29dd8808ca5c52d0dc9e068)

Author SHA1 Message Date
Eddie Cohen 40a75c804c
Validate URLs in web commands before execution (#2616)
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
2023-04-24 12:33:44 +02:00
James Collins 715916a5ba
Merge branch 'master' into bugfix/make-local-memory-json-when-it-doesnt-exist 2023-04-23 16:44:59 -07:00
James Collins a28b8906a6 Add tests in pytest 2023-04-23 16:40:53 -07:00
James Collins aedd288dbe
Refactor/collect embeddings code (#3060)
* Collect all embedding code into a single module

* Collect all embedding code into a single module

* actually, llm_utils is a better place

* Oh, and remove the module now that we don't use it

---------

Co-authored-by: Nicholas Tindle <nick@ntindle.com>
2023-04-23 17:50:50 -05:00
Media 374f543bea
Perm memory test cases (#2996)
* 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>

* init

* more tests

* passing tests

* skip gitbranch decorator on ci

* decorator skiponci

* black

* Update tests/utils.py decorator of skipping ci

Co-authored-by: Nicholas Tindle <nicktindle@outlook.com>

* black

* I oopsed the name

* black

* finally

* perm memory tests

* perm memory tests

---------

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>
Co-authored-by: Nicholas Tindle <nicktindle@outlook.com>
2023-04-23 16:50:15 -05:00
coditamar ec71075bfe
Add tests for json_utils.json_fix_llm (#2952)
* 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>
2023-04-23 16:29:40 -05:00
Vwing d6ef9d1b5d
Make Auto-GPT aware of its running cost (#762)
* 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>
2023-04-23 16:04:31 -05:00
James Collins dcd6aa912b
Add workspace abstraction (#2982)
* Add workspace abstraction

* Remove old workspace implementation

* Extract path resolution to a helper function

* Add api key requirements to new tests
2023-04-23 14:36:04 -05:00
Richard Beales 9ed2a7a2d2
Add missing test decorator (#2989)
* Mark test test_generate_aiconfig_automatic_typical  as @requires_api_key("OPENAI_API_KEY")

* missing import

* add missing decorator
2023-04-23 09:17:18 +01:00
Richard Beales bb786461c7
Mark test test_generate_aiconfig_automatic_typical as @requires_api_… (#2981)
* Mark test test_generate_aiconfig_automatic_typical  as @requires_api_key("OPENAI_API_KEY")

* missing import
2023-04-23 07:35:17 +01:00
Toran Bruce Richards f462674e32
Automatic prompting (#2896)
* 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>
2023-04-23 06:36:10 +01:00
Media 2b5852f7da
Tests utils suite (#2961)
* 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>

* init

* more tests

* passing tests

* skip gitbranch decorator on ci

* decorator skiponci

* black

* Update tests/utils.py decorator of skipping ci

Co-authored-by: Nicholas Tindle <nicktindle@outlook.com>

* black

* I oopsed the name

* black

* finally

* black

* wrong file

---------

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>
Co-authored-by: Nicholas Tindle <nicktindle@outlook.com>
2023-04-22 19:07:28 -05:00
Nicholas Tindle 986bdaab36
Merge pull request #2946 from merwanehamadi/feature/add-decorator-to-tests
add decorator to tests so it's skipped if api key required but not present in the environment
2023-04-23 00:45:55 +02:00
Merwane Hamadi b7cd56f72b
move decorator higher up
Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
2023-04-23 00:45:54 +02:00
Merwane Hamadi eb5a8a87d8
add decorator to tests
Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
2023-04-23 00:45:53 +02:00
Nicholas Tindle 0410331ecd
Merge pull request #2931 from riensen/fix/multiple-plugins
Enable support for loading multiple plugins per zip file
2023-04-23 00:45:50 +02:00
Merwane Hamadi 996a3b331a
Add CI smoke test (#2461) 2023-04-23 00:23:45 +02:00
riensen 8173e4d139 Fix: Mulitple plugins per zip for Auto-GPT-Plugins 2023-04-22 18:31:04 +02:00
Toran Bruce Richards e39cd1bf57
Fix(tests): restore config values after changing them in tests (#2904) 2023-04-22 12:14:18 +02:00
Omri Grossman e09bbc43d4
Merge branch 'master' into tests/basic-spinner-tests 2023-04-22 09:24:25 +03:00
Richard Beales 780a77bb31
Merge pull request #2679 from AndresCdo/feature/add-error-exceptions
[feat] Update milvus_memory_test.py error log
2023-04-22 06:43:53 +01:00
Steve 3ab67e746d
Add file op tests (#2205)
Co-authored-by: Steven Byerly <stevenbyerly@microsoft.com>
2023-04-22 04:17:38 +02:00
Omri Grossman e8aaba9ce2
Run pre commit manually to fix linting and sorting issues 2023-04-22 01:25:20 +03:00
Omri Grossman f3ac658dd0
Reorder imports 2023-04-22 01:18:03 +03:00
Omri Grossman 7c4921758c
Added basic spinner tests and modified spinner method docstring 2023-04-22 01:13:32 +03:00
riensen 9b78e71d16 Use allowlist and denylist naming 2023-04-20 19:01:09 +02:00
Andres Caicedo f99c37aede
Update milvus_memory_test.py
The 'err' variable in the except block is an instance of the ImportError class.
2023-04-20 16:42:34 +02:00
BillSchumacher d8fd834142
linting 2023-04-19 18:34:38 -05:00
BillSchumacher d876de0bef
Make tests a bit spicier and fix, maybe. 2023-04-19 18:32:49 -05:00
BillSchumacher 23c650ca10
Merge branch 'master' of https://github.com/BillSchumacher/Auto-GPT into plugin-support 2023-04-19 17:28:17 -05:00
BillSchumacher 239d64a602
Merge branch 'master' of https://github.com/Significant-Gravitas/Auto-GPT into pr/2032 2023-04-18 19:39:11 -05:00
BillSchumacher aeb1178a47
linting 2023-04-18 19:26:18 -05:00
BillSchumacher 5b86682e24
Skip imagegen tests in CI 2023-04-18 19:24:13 -05:00
BillSchumacher 4c7b582454
apply black 2023-04-18 19:09:15 -05:00
BillSchumacher 3f2d14f4d8
Fix isort? 2023-04-18 19:07:39 -05:00
BillSchumacher 86d3444fb8
isort, add proper skips. 2023-04-18 18:59:23 -05:00
Tymec ac023e95c0 fix: remove "wait-for-model" header from hf request 2023-04-19 01:46:24 +02:00
BillSchumacher 085842d43c
Merge branch 'master' of https://github.com/BillSchumacher/Auto-GPT into plugin-support 2023-04-18 18:44:40 -05:00
Tymec da4c765378 test: added unit test 2023-04-19 01:38:31 +02:00
Evgeny Vakhteev c62c8c6e71 merge BillSchumacher/plugin-support, conflicts 2023-04-18 13:13:38 -07:00
Evgeny Vakhteev 894026cdd4 reshaping code and fixing tests 2023-04-18 12:52:09 -07:00
Evgeny Vakhteev 9fd80a8660 tests, model 2023-04-17 20:51:27 -07:00
Evgeny Vakhteev 9ed5e0f1fc adding plugin interface instantiation 2023-04-17 17:13:53 -07:00
bingokon 31900f6733 Merge remote-tracking branch 'upstream/master'
# Conflicts:
#	autogpt/app.py
#	autogpt/json_fixes/auto_fix.py
#	autogpt/json_fixes/bracket_termination.py
#	autogpt/json_fixes/master_json_fix_method.py
#	autogpt/json_utils/json_fix_llm.py
#	autogpt/json_utils/utilities.py
2023-04-18 00:01:58 +01:00
Evgeny Vakhteev 7f4e38844f adding openai plugin loader 2023-04-17 14:57:55 -07:00
Merwane Hamadi cf9a94a8b6 isort implemented 2023-04-17 13:42:01 -07:00
Richard Beales e849e4ff0b
Merge pull request #1836 from cs0lar/fix/weaviate_index_to_classname
fixes Weaviate index name to classname conversion
2023-04-17 20:21:39 +01:00
Evgeny Vakhteev 08ad320d19 moving load plugins into plugins from main, adding tests 2023-04-17 09:33:01 -07:00
BingokoN d82ca101de Resolved merge conflict: Deleted autogpt/json_fixes/auto_fix.py as in HEAD 2023-04-17 12:25:55 +01:00
BingokoN 0d2e196368 refactoring/splitting the json fix functions into general module and llm module which need AI's assistance. 2023-04-17 12:14:43 +01:00