Commit Graph

13 Commits

Author SHA1 Message Date
Krzysztof Czerwinski
a74548d3cd feat(agent): Component-based Agents (#7054)
This incremental re-architecture unifies Agent code and plugins, so everything is component-based.

## Breaking changes

- Removed command categories and `DISABLED_COMMAND_CATEGORIES` environment variable. Use `DISABLED_COMMANDS` environment variable to disable individual commands.
- Changed `command` decorator; old-style commands are no longer supported. Implement `CommandProvider` on components instead.
- Removed `CommandRegistry`, now all commands are provided by components implementing `CommandProvider`.
- Removed `prompt_config` from `AgentSettings`.
- Removed plugin support: old plugins will no longer be loaded and executed.
- Removed `PromptScratchpad`, it was used by plugins and is no longer needed.
- Changed `ThoughtProcessOutput` from tuple to pydantic `BaseModel`.

## Other changes

- Created `AgentComponent`, protocols and logic to execute them.
- `BaseAgent` and `Agent` is now composed of components.
- Moved some logic from `BaseAgent` to `Agent`.
- Moved agent features and commands to components.
- Removed check if the same operation is about to be executed twice in a row.
- Removed file logging from `FileManagerComponent` (formerly `AgentFileManagerMixin`)
- Updated tests
- Added docs

See [Introduction](https://github.com/kcze/AutoGPT/blob/kpczerwinski/open-440-modular-agents/docs/content/AutoGPT/component%20agent/introduction.md) for more information.
2024-04-22 19:20:01 +02:00
Krzysztof Czerwinski
76d6e61941 feat(agent): Implement more fault tolerant json_loads function (#7016)
* Implement syntax fault tolerant `json_loads` function using `dem3json`
   - Add `dem3json` dependency

* Replace `json.loads` by `json_loads` in places where malformed JSON may occur

* Move `json_utils.py` to `autogpt/core/utils`

* Add tests for `json_utils`

---------

Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
2024-03-21 18:11:36 +01:00
Reinier van der Leer
393d6b97e6 feat(agent): Add Sentry integration for telemetry
* Add Sentry integration for telemetry
   - Add `sentry_sdk` dependency
   - Add setup logic and config flow using `TELEMETRY_OPT_IN` environment variable
      - Add app/telemetry.py with `setup_telemetry` helper routine
      - Call `setup_telemetry` in `cli()` in app/cli.py
      - Add `TELEMETRY_OPT_IN` to .env.template
      - Add helper function `env_file_exists` and routine `set_env_config_value` to app/utils.py
         - Add unit tests for `set_env_config_value` in test_utils.py
      - Add prompt to startup to ask whether the user wants to enable telemetry if the env variable isn't set

* Add `capture_exception` statements for LLM parsing errors and command failures
2024-02-13 18:10:52 +01:00
Reinier van der Leer
dfaeda7cd5 lint(agent/tests): Fix line length in test_utils.py 2024-02-02 18:29:28 +01:00
Reinier van der Leer
9b7fee673e fix(agent/tests): Update test_utils.py:test_extract_json_from_response* in accordance with 956cdc7
Commit 956cdc7 "fix(agent/json_utils): Decode as JSON rather than Python objects" broke these unit tests because they generated "JSON" by stringifying a Python object.
2024-02-02 18:21:19 +01:00
Reinier van der Leer
ba8f83d09d fix: Fix get_current_git_branch test
- Use `InvalidGitRepositoryError` instead of generic `Exception` in `test_get_current_git_branch_failure` to accurately simulate a failure scenario.
2023-12-02 07:02:14 +01:00
Reinier van der Leer
d938c2595e refactor(agent): Fix all trivial linting errors
* Fix all but one flake8 linting errors
  * Remove unused imports
  * Wrap strings that are too long
  * Add basic autogpts/autogpt/.flake8
* Delete planning_agent.py
* Delete default_prompts.py
* Delete _test_json_parser.py
* Refactor the example function call in AgentProfileGeneratorConfiguration from a string to an object
* Rewrite/update docstrings here and there while I'm at it
* Minor change to the description of the `open_file` command
* Use `user-agent` from config in web_selenium.py
* Delete hardcoded ABILITIES from core/planning/templates.py
* Delete duplicate and superseded test from test_image_gen.py
* Fix parameter definitions in mock_commands.py
* Delete code analysis blocks from test_spinner.py, test_url_validation.py
2023-12-02 05:42:10 +01:00
Reinier van der Leer
ca6e9e5e34 lint: Address linting issues from #5458
- Fixed linting issues in `json_utils/utilities.py` and `test_json_utils.py`
2023-11-30 17:20:42 +01:00
HawkClaws
6664eec8ce Improve the accuracy of the extract_dict_from_response method's JSON extraction (#5458) 2023-11-16 15:19:09 +01:00
merwanehamadi
8f41dbe27d Rename Auto-GPT to AutoGPT (#5301)
* Rename to AutoGPT

Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>

* Update autogpts/autogpt/BULLETIN.md

Co-authored-by: Reinier van der Leer <pwuts@agpt.co>

* Update BULLETIN.md

* Update docker-compose.yml

* Update autogpts/forge/tutorials/001_getting_started.md

Co-authored-by: Reinier van der Leer <pwuts@agpt.co>

* Update autogpts/autogpt/tests/unit/test_logs.py

Co-authored-by: Reinier van der Leer <pwuts@agpt.co>

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update introduction.md

* Update plugins.md

---------

Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
2023-09-22 15:49:29 -07:00
Reinier van der Leer
7720f6af24 AutoGPT: replace autogpt.llm.* with LLM infrastructure of autogpt.core;
* Removed `autogpt.llm.base` and `autogpt.llm.utils`
* `core` does things async, so `Agent.think()` and `Agent.execute()` are now also async
* Renamed `dump()` and `parse()` on `JSONSchema` to `to_dict()` and `from_dict()`
* Removed `MessageHistory`

* Also, some typo's and linting fixes here and there
2023-09-21 16:38:41 +02:00
Reinier van der Leer
6d7d5ae065 Auto-GPT: fix test_get_bulletin_from_web_success 2023-09-09 03:34:57 +02:00
Merwane Hamadi
8489052358 Move Auto-GPT to autogpts/autogpt 2023-09-05 09:40:24 -07:00