Commit Graph

5468 Commits (6ffa644fb636b196ae3154276c4f099b0d244534)

Author SHA1 Message Date
Reinier van der Leer 04769c54e4 docs: Update CONTRIBUTING.md
- Add links to roadmap
- Disable links to kanban board (which currently is not in active use)
- Clarify instruction to not submit broken code
2024-06-09 23:43:25 +02:00
Reinier van der Leer 8f18aebf90 Update wiki links to new location (Nexus/wiki -> AutoGPT/wiki) 2024-06-09 23:13:25 +02:00
github-actions[bot] 8e5535157f
feat(frontend): Update frontend build in `master` (#7203)
Update frontend build based on commit 8f43a346e9

Co-authored-by: Pwuts <12185583+Pwuts@users.noreply.github.com>
2024-06-08 18:55:01 -05:00
Reinier van der Leer 8f43a346e9
fix(frontend): Sync request models up with `forge.agent_protocol` (#7202)
Frontend broke in #7171 because of changes to the request models in `forge.agent_protocol`. This PR unbreaks it.

Changes:
- Make `input` required on `TaskRequestBody` and `StepRequestBody`
- Amend `toJson()` on `TaskRequestBody` and `StepRequestBody` to omit attributes with `null` value
2024-06-08 17:09:01 -05:00
Reinier van der Leer f2cb553c9a chore(agent, forge, benchmark): Update `pyright` to v1.1.366 2024-06-08 21:48:25 +02:00
Reinier van der Leer 4c17277539 chore(agent, forge): Update `duckduckgo-search` to v5.3.1 2024-06-08 21:44:39 +02:00
Krzysztof Czerwinski 2cd914d366
chore(agent): Remove `LogCycleHandler` (#7192)
- Remove no longer needed LogCycleHandler class and its usage in Agent
2024-06-06 11:47:30 +01:00
Swifty 39084192ff
fix(agent server): Update file layout for autogpt server (#7190) 2024-06-05 12:53:54 +02:00
Nicholas Tindle 23dfdad454
feat(autogpt,autogpt_server): Build AutoGPT's Constituent Parts for deployment (#7188) 2024-06-05 12:14:08 +07:00
Zamil Majdy 4de0fd8cbd
feat(db): Initialize Database Schema for AutoGPT server (#7168)
### Background

Introduced initial database schema for AutoGPT server.
It currently consists of 7 tables:

* `AgentGraph`: This model describes the Agent Graph/Flow (Multi Agent System).
    * `AgentNode`: This model describes a single node in the Agent Graph/Flow (Multi Agent System).
        * `AgentNodeLink`: This model describes the link between two AgentNodes.
        * `AgentNodeExecution`: This model describes the execution of an AgentNode.
* `AgentBlock`: This model describes a component that will be executed by the AgentNode (all the details required, like name, code, input/output).
    * `AgentBlockInputOutput`: This model describes the output (produced event) or input (consumed event) of an AgentBlock.
* `FileDefinition`: This model describe a file that can be used as input/output of an AgentNodeExecution.

### Changes 🏗️

* Add Prisma
* Add sqlite3
* Initialize database.
2024-06-05 12:09:58 +07:00
Swifty e3a5663a05
fix(agent server): Updated function names and type checking (#7185)
* fix agent server

* renamed functions

* simplified dir naming
2024-06-04 11:02:38 +02:00
SwiftyOS 246bc850a1 deleted nextgenautogpt 2024-06-04 09:56:42 +02:00
Reinier van der Leer 319232568a
fix+docs(agent): Update LLM access instructions & remove GPT-specific flags (#7183)
* Update instructions to set up OpenAI / GPT-4 access
* Add instructions to set up Anthropic access
* Add instructions to set up Groq access
* Remove GPT-specific `--gpt3only`, `--gpt4only` CLI flags and related logic
* Remove duplicate config instructions from docker setup page, replace it by a link to the standard setup instructions
2024-06-03 08:51:46 -05:00
SwiftyOS f71d97dd48 restored nextgenautogpt 2024-06-03 11:42:18 +02:00
Zamil Majdy 7a932cdf00
feat(rnd): add FastAPI support to existing project outline (#7165)
### Background

###### Project Outline
Currently, the project mainly consists of these components:

*agent_api*
A component that will expose API endpoints for the creation & execution of agents.
This component will make connections to the database to persist and read the agents.
It will also trigger the agent execution by pushing its execution request to the ExecutionQueue.

*agent_executor*
A component that will execute the agents.
This component will be a pool of processes/threads that will consume the ExecutionQueue and execute the agent accordingly. 
The result and progress of its execution will be persisted in the database.

###### How to test
Execute `poetry run app`. 
Access the swagger page `http://localhost:8000/docs`, there is one API to trigger an execution of one dummy slow task, you fire the API a couple of times and see the `agent_executor` executes the multiple slow tasks concurrently by the pool of Python processes.
The pool size is currently set to `5` (hardcoded in app.py, the code entry point).

##### Changes 🏗️

* Initialize FastAPI for the AutoGPT server project.
* Reduced number of queues to 1 and abstracted into `ExecutionQueue` class.
* Reduced the number of main components into two `api` and `executor`.
2024-06-02 23:39:01 -05:00
Reinier van der Leer 4e76768bc9
refactor(forge/llm): Create `BaseOpenAIProvider` -> deduplicate `GroqProvider` & `OpenAIProvider` implementation (#7178)
- Add `_BaseOpenAIProvider`, `BaseOpenAIChatProvider`, and `BaseOpenAIEmbeddingProvider`, which implement the shared functionality of OpenAI-like providers, e.g. `GroqProvider` and `OpenAIProvider`
- (Re)move as much code as possible from `GroqProvider` and `OpenAIProvider` by rebasing them on `BaseOpenAI(Chat|Embedding)Provider`

Also:
- Rename `get_available_models()` to `get_available_chat_models()` on `BaseChatModelProvider`
- Add `get_available_models()` to `BaseModelProvider`
- Add `get_available_embedding_models()` to `BaseEmbeddingModelProvider`
- Move common `fix_failed_parse_tries` config attribute into base `ModelProviderConfiguration`
2024-06-03 01:29:24 +02:00
RainRat cb9ad6f64d
fix typos (#7123)
* fix typos in various places

* Revert changes to NOTICES

---------

Co-authored-by: Nicholas Tindle <nicholas.tindle@agpt.co>
2024-05-31 11:16:23 +02:00
Reinier van der Leer 16df151977
fix(agent): Disable profile generator -> speed up agent setup (#7121)
* Add default AutoGPT profile to ai_profile.py & disable profile generator

* Disable custom AI profile generation in agent_protocol_server.py
   - Replace `generate_agent_for_task` by `create_agent`
   - Make `ai_profile` parameter on `create_agent` optional (use default `AIProfile` if not passed)

* Generalize example call in profile_generator.py
   Currently it's specified in an OpenAI-specific format, which might adversely affect performance with other providers.

* Remove dead `AIProfile.api_budget` attribute

* Remove `agent.ai_profile` and `agent.directives` attributes, and replace usages with `agent.state.*`
   This prevents potential state inconsistency between `agent` and `agent.state` when other values are assigned to `agent.ai_profile` and `agent.directives`
2024-05-31 10:34:33 +02:00
rekwet f67c2147a7
feat(docs): Update QUICKSTART.md (#7104)
Updated the grammar and sentence construction of the Agent Start section.
2024-05-30 22:58:08 -05:00
Reinier van der Leer 738c8ffff0
fix(benchmark): Improve output and debug logging of pytest evals 2024-05-30 17:16:17 +02:00
Reinier van der Leer f107ff8cf0
Set up unified pre-commit + CI w/ linting + type checking & FIX EVERYTHING (#7171)
- **FIX ALL LINT/TYPE ERRORS IN AUTOGPT, FORGE, AND BENCHMARK**

### Linting
- Clean up linter configs for `autogpt`, `forge`, and `benchmark`
- Add type checking with Pyright
- Create unified pre-commit config
- Create unified linting and type checking CI workflow

### Testing
- Synchronize CI test setups for `autogpt`, `forge`, and `benchmark`
   - Add missing pytest-cov to benchmark dependencies
- Mark GCS tests as slow to speed up pre-commit test runs
- Repair `forge` test suite
  - Add `AgentDB.close()` method for test DB teardown in db_test.py
  - Use actual temporary dir instead of forge/test_workspace/
- Move left-behind dependencies for moved `forge`-code to from autogpt to forge

### Notable type changes
- Replace uses of `ChatModelProvider` by `MultiProvider`
- Removed unnecessary exports from various __init__.py
- Simplify `FileStorage.open_file` signature by removing `IOBase` from return type union
  - Implement `S3BinaryIOWrapper(BinaryIO)` type interposer for `S3FileStorage`

- Expand overloads of `GCSFileStorage.open_file` for improved typing of read and write modes

  Had to silence type checking for the extra overloads, because (I think) Pyright is reporting a false-positive:
  https://github.com/microsoft/pyright/issues/8007

- Change `count_tokens`, `get_tokenizer`, `count_message_tokens` methods on `ModelProvider`s from class methods to instance methods

- Move `CompletionModelFunction.schema` method -> helper function `format_function_def_for_openai` in `forge.llm.providers.openai`

- Rename `ModelProvider` -> `BaseModelProvider`
- Rename `ChatModelProvider` -> `BaseChatModelProvider`
- Add type `ChatModelProvider` which is a union of all subclasses of `BaseChatModelProvider`

### Removed rather than fixed
- Remove deprecated and broken autogpt/agbenchmark_config/benchmarks.py
- Various base classes and properties on base classes in `forge.llm.providers.schema` and `forge.models.providers`

### Fixes for other issues that came to light
- Clean up `forge.agent_protocol.api_router`, `forge.agent_protocol.database`, and `forge.agent.agent`

- Add fallback behavior to `ImageGeneratorComponent`
   - Remove test for deprecated failure behavior

- Fix `agbenchmark.challenges.builtin` challenge exclusion mechanism on Windows

- Fix `_tool_calls_compat_extract_calls` in `forge.llm.providers.openai`

- Add support for `any` (= no type specified) in `JSONSchema.typescript_type`
2024-05-28 05:04:21 +02:00
Reinier van der Leer 2c13a2706c
fix(agent, forge): Update `tiktoken` for GPT-4o support
and remove `tiktoken` from autogpt/pyproject.toml since it isn't a direct dependency anymore
2024-05-27 13:10:19 +02:00
Nicholas Tindle 46c1762fb0
feat(forge/llm): Add basic support for GPT-4o (#7169)
* Add `gpt-4o`
* Add `gpt-4o-2024-05-13`

---------

Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
2024-05-24 22:35:48 +02:00
Krzysztof Czerwinski 4e02f7ddb5
feat(forge): Add `mount` method to `FileStorage` & execute code in mounted workspace (#7115)
* Add `FileStorage.mount()` method, which mounts (part of) the workspace to a local path
  * Add `watchdog` library to watch file changes in mount
* Amend `CodeExecutorComponent`
  * Amend `execute_python_file` to execute Python files in a workspace mount
  * Amend `execute_python_code` to create temporary .py file in workspace instead of as a local file
  * Add support for `Path` argument to `filename` parameter on `execute_python_file`

* Fix `test_execute_python_code` (by making it async)
2024-05-24 21:34:22 +02:00
Reinier van der Leer edcbbbce25
feat(forge/llm): Add `GroqProvider` (#7130)
* Add `GroqProvider` in `forge.llm.providers.groq`
  * Add to `llm.providers.multi`
  * Add `groq` dependency (v0.8.0)

* Update AutoGPT docs & config template
  * Update .env.template
  * Update docs
2024-05-24 16:34:51 +02:00
Krzysztof Czerwinski cdae98d36b
fix(ci): Fix cli and CI (#7166)
- Add a special case for cli to handle autogpt and forge agent
- Remove forge agent from smoke test ci
2024-05-22 17:18:00 +01:00
Reinier van der Leer 5292736779
fix(agent): Unbreak docker builds after repo restructure (#7164)
- Move `autogpt/Dockerfile` to `Dockerfile.autogpt`
  - Write new selective `.dockerignore` (in repo root) to keep build context clean
  - Amend `autogpt/docker-compose.yml` and all `autogpt-docker-*.yml` workflows accordingly

- Include `forge/` in docker build context so it can be used as a path dependency

- Include `frontend/` in docker builds
2024-05-22 18:11:16 +02:00
Reinier van der Leer e16d58af0c
mark docs/_javascript/** as `linguist-vendored` 2024-05-22 16:44:14 +02:00
Reinier van der Leer f80bc0a523
fix marking frontend builds as `linguist-generated` to exclude from language stats 2024-05-22 16:38:56 +02:00
Swifty a5ee640935
feat(rnd): Add template of the next gen autogpt project (#7162)
* feat(rnd): Add template of the next gen autogpt project

* fix(rnd): fix typo

* fix(rnd): typo

* Added multi-processor arch

* feat(rnd) add bi-direction communication

* Updated project structure
2024-05-22 14:36:38 +02:00
Krzysztof Czerwinski 4c325724ec
refactor(autogpt, forge): Remove `autogpts` directory (#7163)
- Moved `autogpt` and `forge` to project root
- Removed `autogpts` directory
- Moved and renamed submodule `autogpts/autogpt/tests/vcr_cassettes` to `autogpt/tests/vcr_cassettes`
- When using CLI agents will be created in `agents` directory (instead of `autogpts`)
- Renamed relevant docs, code and config references from `autogpts/[forge|autogpt]` to `[forge|autogpt]` and from `*../../*` to `*../*`
- Updated `CODEOWNERS`, GitHub Actions and Docker `*.yml` configs
- Updated symbolic links in `docs`
2024-05-22 13:08:54 +01:00
Krzysztof Czerwinski 3475aaf384
refactor(agent): Remove unused `autogpt` code (#7112)
Remove unused `autogpt` code and reorganize its file structure.

* Moved:
  * `autogpt/agent_manager/agent_manager.py` to `autogpt/agents/agent_manager.py`, so the dir `agent_manager` was removed
  * `dump_prompt` from `autogpt.core.runner.client_lib.logging.helpers` to `forge/llm/prompting/utils.py`
  * `coroutine` decorator from `autogpt.core.runner.client_lib.utils` to `autogpt/app/utils.py`
* Removed within `autogpt`:
  * Memory-related code from multiple files (not used), including `memory/*`
  * Memory-related config entries/env vars: `memory_backend`, `memory_index`, `redis_host`, `redis_port`, `redis_password`, `wipe_redis_on_start`
  * `core` files, from failed re-arch:
    * `*.md` docs
    * `core/ability/*`
    * `core/agent/*`
    * `core/memory/*`
    * `core/planning/*`
    * `core/plugin/*`
    * `core/workspace/*`
    * `core/runner/*` (`dump_prompt` and `coroutine` were moved)
  * Related tests
* Updated relevant docs
2024-05-22 09:43:15 +01:00
Krzysztof Czerwinski bcc5282aba
refactor(forge): Clean `forge` (#7117)
Remove unused `forge` code and improve structure of `forge`.

* Put all Agent Protocol stuff together in `forge.agent_protocol`
  * ... including `forge.agent_protocol.database` (was `forge.db`)
* Remove duplicate/unused parts from `forge`
  * `forge.actions`, containing old commands; replaced by `forge.components` from `autogpt`
  * `forge/agent.py` (the old one, `ForgeAgent`)
  * `forge/app.py`, which was used to serve and run the `ForgeAgent`
  * `forge/db.py` (`ForgeDatabase`), which was used for `ForgeAgent`
  * `forge/llm.py`, which has been replaced by new `forge.llm` module which was ported from `autogpt.core.resource.model_providers`
  * `forge.memory`, which is not in use and not being maintained
  * `forge.sdk`, much of which was moved into other modules and the rest is deprecated
  * `AccessDeniedError`: unused
  * `forge_log.py`: replaced with `logging`
  * `validate_yaml_file`: not needed
  * `ai_settings_file` and associated loading logic and env var `AI_SETTINGS_FILE`: unused
  * `prompt_settings_file` and associated loading logic and env var `PROMPT_SETTINGS_FILE`: default directives are now provided by the `SystemComponent`
    * `request_user_double_check`, which was only used in `AIDirectives.load`
  * `TypingConsoleHandler`: not used
2024-05-21 19:18:47 +01:00
Swifty 2cca4fa47f
clean(benchmark): Remove Depreciated Challenges (#7144)
* Remove depreciated challanges

* Update license and pyproject.toml
2024-05-20 15:01:36 +02:00
Krzysztof Czerwinski e8d7dfa386
refactor(agent, forge): Move library code from `autogpt` to `forge` (#7106)
Moved from `autogpt` to `forge`:
- `autogpt.config`          -> `forge.config`
- `autogpt.processing`      -> `forge.content_processing`
- `autogpt.file_storage`    -> `forge.file_storage`
- `autogpt.logs`            -> `forge.logging`
- `autogpt.speech`          -> `forge.speech`
- `autogpt.agents.(base|components|protocols)`  -> `forge.agent.*`
- `autogpt.command_decorator`                   -> `forge.command.decorator`
- `autogpt.models.(command|command_parameter)`  -> `forge.command.(command|parameter)`
- `autogpt.(commands|components|features)`      -> `forge.components`
- `autogpt.core.utils.json_utils`           -> `forge.json.parsing`
- `autogpt.prompts.utils`                   -> `forge.llm.prompting.utils`
- `autogpt.core.prompting.(base|schema|utils)`    -> `forge.llm.prompting.*`
- `autogpt.core.resource.model_providers`   -> `forge.llm.providers`
- `autogpt.llm.providers.openai` + `autogpt.core.resource.model_providers.utils`
                                            -> `forge.llm.providers.utils`
- `autogpt.models.action_history:Action*`   -> `forge.models.action`
- `autogpt.core.configuration.schema`       -> `forge.models.config`
- `autogpt.core.utils.json_schema`          -> `forge.models.json_schema`
- `autogpt.core.resource.schema`            -> `forge.models.providers`
- `autogpt.models.utils`                    -> `forge.models.utils`
- `forge.sdk.(errors|utils)` + `autogpt.utils.(exceptions|file_operations_utils|validators)`
                        -> `forge.utils.(exceptions|file_operations|url_validator)`
- `autogpt.utils.utils` -> `forge.utils.const` + `forge.utils.yaml_validator`

Moved within `forge`:
- forge/prompts/* -> forge/llm/prompting/*

The rest are mostly import updates, and some sporadic removals and necessary updates (for example to fix circular deps):
- Changed `CommandOutput = Any` to remove coupling with `ContextItem` (no longer needed)
- Removed unused `Singleton` class
- Reluctantly moved `speech` to forge due to coupling (tts needs to be changed into component)
- Moved `function_specs_from_commands` and `core/resource/model_providers` to `llm/providers` (resources were a `core` thing and are no longer relevant)
- Keep tests in `autogpt` to reduce changes in this PR
- Removed unused memory-related code from tests
- Removed duplicated classes: `FancyConsoleFormatter`, `BelowLevelFilter`
- `prompt_settings.yaml` is in both `autogpt` and `forge` because for some reason doesn't work when placed in just one dir (need to be taken care of)
- Removed `config` param from `clean_input`, it wasn't used and caused circular dependency
- Renamed `BaseAgentActionProposal` to `ActionProposal`
- Updated `pyproject.toml` in `forge` and `autogpt`
- Moved `Action*` models from `forge/components/action_history/model.py` to `forge/models/action.py` as those are relevant to the entire agent and not just `EventHistoryComponent` + to reduce coupling
- Renamed `DEFAULT_ASK_COMMAND` to `ASK_COMMAND` and `DEFAULT_FINISH_COMMAND` to `FINISH_COMMAND`
- Renamed `AutoGptFormatter` to `ForgeFormatter` and moved to `forge`

Includes changes from PR https://github.com/Significant-Gravitas/AutoGPT/pull/7148
---------

Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
2024-05-16 00:37:53 +02:00
Zamil Majdy 4f81246fd4
Fix poetry install issue on ARM64 & python 3.12 (#7145) 2024-05-14 09:10:55 -05:00
SwiftyOS 4fe62b8063 new frontend build as ci is broke 2024-05-11 09:22:59 +02:00
SwiftyOS b3967fd597 remove leaderboard 2024-05-11 09:15:09 +02:00
SwiftyOS 1f05881283 fix: typo 2024-05-11 08:45:51 +02:00
SwiftyOS a9afb3cbff removed git requirement from cli 2024-05-11 08:41:52 +02:00
Reinier van der Leer c562b3b6a3
unbreak `./run agent create`
"If we had done this in Swift it would've never happened" ~Craig Swift

                ____
              / . .\
              \  ---<
               \  /
       ________/ /
    -=:___________/
2024-05-10 12:53:57 +02:00
Reinier van der Leer b0cbf711dc
feat(agent): Persist `AgentContext` in `Agent.state` (#7125)
Persist the agent's `AgentContext` so that it works in rehydrated agent instances. This makes context usable in the `AgentProtocolServer`, where the agent instance is loaded and destroyed for every step.

- Make `AgentContext` a Pydantic model
- Add `context` parameter to `ContextComponent.__init__` so we can pass in an existing instance
- Add `context: AgentContext` to `AgentSettings` so it is persisted
- Add `type` attribute to `ContextItem` implementations as a discriminator
- Rename `ContextItem` base class to `BaseContextItem` and make new `ContextItem` type alias (union of the implementation types)
2024-05-10 09:30:12 +02:00
Reinier van der Leer 7e02cfdc9f
fix(agent): Fix type propagation of `Command` and `@command` when used on methods (#7124) 2024-05-09 11:39:09 +02:00
Swifty 34fdbaa26b
Remove arena (#7134)
* remove arena

* refactor: Remove Arena intake workflow

* Remove all mention of the arena

* remove evo.ninja
2024-05-09 11:36:40 +02:00
Swifty 818d391284
Remove arena submission from cli (#7137) 2024-05-09 11:27:16 +02:00
Reinier van der Leer 08c32a7a12
lint: Fix linting errors in git_log_to_release_notes.py 2024-05-07 18:53:19 +02:00
Reinier van der Leer 56104bd047
feat(agent/core): Allow `list[ChatMessage]` in `dump_prompt` 2024-05-07 16:43:28 +02:00
Reinier van der Leer 2ef5cd7d4c
fix(agent): Swap target files and symlinks of component documentation to make package buildable
Documentation files were in docs/content/AutoGPT/components, symlinks in autogpts/autogpt/autogpt/(agents|commands).
Chef doesn't allow symlinks that point to locations outside of package dir.
Replacing the documentation files with symlinks, and symlinks with the actual documentation files, should fix this.
2024-05-07 13:44:31 +02:00
Reinier van der Leer 74b3aae5c6
fix(agent/docs): Fix symlinks to component-based agent docs 2024-05-07 13:35:58 +02:00
Reinier van der Leer e9b3b5090c
lint(agent): Add `flake8` to pre-commit checks 2024-05-07 13:30:10 +02:00