Commit Graph

35 Commits (d5ab83aa34cdcb970c5b25b38681ef1783f68f17)

Author SHA1 Message Date
Reinier van der Leer cbae8b5c14
chore(agent, forge, benchmark): Clean up dependencies (#7286)
* Remove unused dependencies
* Move dependencies for moved code from `autogpt` to `forge`
* Loosen dependency for `uvicorn` to improve compatibility
2024-06-28 02:21:36 +02:00
Reinier van der Leer fbb3891e79 chore(forge, agent, benchmark): Update `pytest-asyncio` to v0.23.x
Resolves #7283
2024-06-27 14:09:36 -06:00
Bently 3e01b19d6f
chore(forge): Update `duckduckgo-search` to v6.1.7 (#7254)
This should (for now) mitigate the RateLimitErrors that people have been experiencing.
---------

Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
2024-06-25 03:24:10 +02:00
Krzysztof Czerwinski c19ab2b24f
feat(forge): Component-specific configuration (#7170)
Remove many env vars and use component-level configuration that could be loaded from file instead.

### Changed

- `BaseAgent` provides `serialize_configs` and `deserialize_configs` that can save and load all component configuration as json `str`. Deserialized components/values overwrite existing values, so not all values need to be present in the serialized config.
- Decoupled `forge/content_processing/text.py` from `Config`
- Kept `execute_local_commands` in `Config` because it's needed to know if OS info should be included in the prompt
- Updated docs to reflect changes
- Renamed `Config` to `AppConfig`

### Added

- Added `ConfigurableComponent` class for components and following configs:
  - `ActionHistoryConfiguration`
  - `CodeExecutorConfiguration`
  - `FileManagerConfiguration` - now file manager allows to have multiple agents using the same workspace
  - `GitOperationsConfiguration`
  - `ImageGeneratorConfiguration`
  - `WebSearchConfiguration`
  - `WebSeleniumConfiguration`
- `BaseConfig` in `forge` and moved `Config` (now inherits from `BaseConfig`) back to `autogpt`
- Required `config_class` attribute for the `ConfigurableComponent` class that should be set to configuration class for a component
`--component-config-file` CLI option and `COMPONENT_CONFIG_FILE` env var and field in `Config`. This option allows to load configuration from a specific file, CLI option takes precedence over env var.
- Added comments to config models

### Removed

- Unused `change_agent_id` method from `FileManagerComponent`
- Unused `allow_downloads` from `Config` and CLI options (it should be in web component config if needed)
- CLI option `--browser-name` (the option is inside `WebSeleniumConfiguration`)
- Unused `workspace_directory` from CLI options
- No longer needed variables from `Config` and docs
- Unused fields from `Config`: `image_size`, `audio_to_text_provider`, `huggingface_audio_to_text_model`
- Removed `files` and `workspace` class attributes from `FileManagerComponent`
2024-06-19 09:14:01 +01:00
Reinier van der Leer 227cf41612
fix(agent, forge): Make LLM API key check provider-agnostic (#7220)
* Rename `assert_config_has_openai_api_key` to `assert_config_has_required_llm_api_keys`
* Make OpenAI credential check conditional (only if an OpenAI model is selected in the config)
* Implement checks for Groq and Anthropic credentials
* Use API calls for Groq and OpenAI credential checks to make sure the keys are valid
2024-06-14 20:56:03 +02:00
Krzysztof Czerwinski 9f71cd2437
feat(forge): Unbreak `forge` agent (#7196)
Revert some changes to fix forge agent and enable components support.
- Rename forge `Agent` to `ProtocolAgent`
- Bring back and update `forge/app.py` and `forge/agent/forge_agent.py`
- `ForgeAgent` inherits from `BaseAgent`, supports component execution and runs the same pipelines as autogpt Agent
- Update forge version from 0.1.0 to 0.2.0
- Update code comments
2024-06-12 13:45:00 +01: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
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
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 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
SwiftyOS 5a2833ffb8 moved forge into autogpts 2023-09-14 15:53:55 +02:00
merwanehamadi 144d159695
Add config (#5210)
* Fix API Mode

* Change config forge
2023-09-13 07:37:14 -07:00
Merwane Hamadi afce057b19 Fix forgeAgent class 2023-09-12 12:34:32 -07:00
SwiftyOS 255144bf78 Renamed forge module forge from autogpt 2023-09-12 11:00:05 +02:00
Merwane Hamadi cd4589d4d9 Add CI to the forge
Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
2023-09-11 16:12:44 -07:00
Swifty d16d8b70e3
Forge - Addition of MemStore and Abstract Base Class (#5165) 2023-09-06 19:26:23 +02:00
SwiftyOS 751cde420b Added abstract memstore and base/helper functions 2023-09-06 19:23:27 +02:00
hunteraraujo 2883ea0abb Update schema.py 2023-09-06 10:09:31 -07:00
hunteraraujo e56a2b1f41 Allow null input in StepRequestBody for Continuous Chat Mode 2023-09-06 10:02:13 -07:00
SwiftyOS e364804615 Added generic memstore 2023-09-06 16:29:31 +02:00
Silen Naihin 583eedc240 adding hypercorn 2023-09-05 18:32:29 -07:00
Merwane Hamadi 668fc8c352 Fix forge and benchmark 2 2023-09-05 17:05:45 -07:00
Merwane Hamadi 81bdcb9477 Fix forge and benchmark 2023-09-05 16:58:09 -07:00
Swifty cf2952f338
Addition of Simple Memory System Based on ChromaDB (#28) 2023-09-05 16:51:14 +02:00
SwiftyOS 1277e368c1 Added prompt techniques 2023-09-05 13:28:52 +02:00
Swifty c8c57059eb
Addition of Ability Register and Sample Ability (#27) 2023-09-05 13:13:29 +02:00
SwiftyOS b9be0f7834 removed script 2023-09-04 16:33:39 +02:00
SwiftyOS e5cef441e2 Re-Organised project and added benchmark code 2023-09-04 16:21:09 +02:00