Commit Graph

16 Commits

Author SHA1 Message Date
Reinier van der Leer
db95d4cb84 Agent loop v2: Planning & Task Management (part 1: refactoring) (#4799)
* Move rename module `agent` -> `agents`

* WIP: abstract agent structure into base class and port Agent

* Move command arg path sanitization to decorator

* Add fallback token limit in llm.utils.create_chat_completion

* Rebase `MessageHistory` class on `ChatSequence` class

* Fix linting

* Consolidate logging modules

* Wham Bam Boom

* Fix tests & linting complaints

* Update Agent class docstring

* Fix Agent import in autogpt.llm.providers.openai

* Fix agent kwarg in test_execute_code.py

* Fix benchmarks.py

* Clean up lingering Agent(ai_name=...) initializations

* Fix agent kwarg

* Make sanitize_path_arg decorator more robust

* Fix linting

* Fix command enabling lambda's

* Use relative paths in file ops logger

* Fix test_execute_python_file_not_found

* Fix Config model validation breaking on .plugins

* Define validator for Config.plugins

* Fix Config model issues

* Fix agent iteration budget in testing

* Fix declaration of context_while_think

* Fix Agent.parse_and_process_response signature

* Fix Agent cycle_budget usages

* Fix budget checking in BaseAgent.__next__

* Fix cycle budget initialization

* Fix function calling in BaseAgent.think()

* Include functions in token length calculation

* Fix Config errors

* Add debug thing to patched_api_requestor to investigate HTTP 400 errors

* If this works I'm gonna be sad

* Fix BaseAgent cycle budget logic and document attributes

* Document attributes on `Agent`

* Fix import issues between Agent and MessageHistory

* Improve typing

* Extract application code from the agent (#4982)

* Extract application code from the agent

* Wrap interaction loop in a function and call in benchmarks

* Forgot the important function call

* Add docstrings and inline comments to run loop

* Update typing and docstrings in agent

* Docstring formatting

* Separate prompt construction from on_before_think

* Use `self.default_cycle_instruction` in `Agent.think()`

* Fix formatting

* hot fix the SIGINT handler (#4997)

The signal handler in the autogpt/main.py doesn't work properly because
of the clean_input(...) func. This commit remedies this issue. The issue
is mentioned in
3966cdfd69 (r1264278776)

* Update the sigint handler to be smart enough to actually work (#4999)

* Update the sigint handler to be smart enough to actually work

* Update autogpt/main.py

Co-authored-by: Reinier van der Leer <github@pwuts.nl>

* Can still use context manager

* Merge in upstream

---------

Co-authored-by: Reinier van der Leer <github@pwuts.nl>

* Fix CI

* Fix initial prompt construction

* off by one error

* allow exit/EXIT to shut down app

* Remove dead code

---------

Co-authored-by: collijk <collijk@uw.edu>
Co-authored-by: Cyrus <39694513+cyrus-hawk@users.noreply.github.com>
2023-07-20 17:34:49 +02:00
Erik Peterson
857d26d101 Add OpenAI function call support (#4683)
Co-authored-by: merwanehamadi <merwanehamadi@gmail.com>
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
2023-06-22 04:52:44 +02:00
merwanehamadi
e5d6206a15 Make JSON errors more silent (#4748) 2023-06-20 07:01:49 -07:00
Erik Peterson
9f737274b7 Fix issues with execute_python_code responses (#4738)
Co-authored-by: merwanehamadi <merwanehamadi@gmail.com>
2023-06-18 20:30:08 -07:00
merwanehamadi
a7f805604c Pass config everywhere in order to get rid of singleton (#4666)
Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
2023-06-18 19:05:41 -07:00
merwanehamadi
0b6fec4a28 Fix summarization happening in first cycle (#4719) 2023-06-16 18:17:47 -07:00
Erik Peterson
07d9b584f7 Correct and clean up JSON handling (#4655)
* Correct and clean up JSON handling

* Use ast for message history too

* Lint

* Add comments explaining why we use literal_eval

* Add descriptions to llm_response_format schema

* Parse responses in code blocks

* Be more careful when parsing in code blocks

* Lint
2023-06-13 09:54:50 -07:00
Reinier van der Leer
0e1c0c55f8 Synchronize stable -> master (#3677)
* Revert "Merge branch 'master' into stable"

This reverts commit c4008971f7, reversing
changes made to fe855fef13.

* Fix `validate_json` file error when cwd != project root (#2665)

Co-authored-by: qianchengliang <qianchengliang1@huawei.com>

* Revert "Revert "Merge branch 'master' into stable""

This reverts commit 999990b614.

---------

Co-authored-by: BillSchumacher <34168009+BillSchumacher@users.noreply.github.com>
Co-authored-by: Mick <30898949+mickjagger19@users.noreply.github.com>
Co-authored-by: qianchengliang <qianchengliang1@huawei.com>
2023-05-02 12:17:09 +01:00
k-boikov
0ef6f06462 Fix validate_json scheme path (#3631)
Co-authored-by: Reinier van der Leer <github@pwuts.nl>
2023-05-01 20:06:22 +02:00
Richard Beales
06ae4684c8 replace 50+ occurrences of print() with logger (#3056)
Co-authored-by: James Collins <collijk@uw.edu>
Co-authored-by: Luke Kyohere <lkyohere@mfsafrica.com>
Co-authored-by: k-boikov <64261260+k-boikov@users.noreply.github.com>
Co-authored-by: Media <12145726+rihp@users.noreply.github.com>
Co-authored-by: Nicholas Tindle <nick@ntindle.com>
2023-04-29 23:40:57 -05:00
merwanehamadi
aa3e37ac14 Fix memory by adding it only when context window full (#3469)
* Fix memory by adding it only when context window full

* clean json utils
2023-04-28 21:07:49 +01:00
BillSchumacher
6e94409594 linting 2023-04-18 19:40:14 -05:00
bingokon
6787c2eeed fix json_schemas not found error 2023-04-18 00:17:42 +01: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
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
bingokon
7a32e03bd5 refactoring the all json utilities 2023-04-17 00:48:53 +01:00