aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-04-16refactor(agent): Refactor & improve `create_chat_completion` (#7082)Gravatar Reinier van der Leer 8-113/+208
* refactor(agent/core): Rearrange and split up `OpenAIProvider.create_chat_completion` - Rearrange to reduce complexity, improve separation/abstraction of concerns, and allow multiple points of failure during parsing - Move conversion from `ChatMessage` to `openai.types.ChatCompletionMessageParam` to `_get_chat_completion_args` - Move token usage and cost tracking boilerplate code to `_create_chat_completion` - Move tool call conversion/parsing to `_parse_assistant_tool_calls` (new) * fix(agent/core): Handle decoding of function call arguments in `create_chat_completion` - Amend `model_providers.schema`: change type of `arguments` from `str` to `dict[str, Any]` on `AssistantFunctionCall` and `AssistantFunctionCallDict` - Implement robust and transparent parsing in `OpenAIProvider._parse_assistant_tool_calls` - Remove now unnecessary `json_loads` calls throughout codebase * feat(agent/utils): Improve conditions and errors in `json_loads` - Include all decoding errors when raising a ValueError on decode failure - Use errors returned by `return_errors` instead of an error buffer - Fix check for decode failure
2024-04-12feat(agent): Improve feedback in `create_chat_completion` parse-fix mechanismGravatar Reinier van der Leer 1-1/+4
Include error type in feedback message
2024-04-12refactor(agent/utils): Clean up `JSONSchema.validate_object` signature & ↵Gravatar Reinier van der Leer 2-16/+9
docstring
2024-04-12fix(agent): Make `Agent.save_state` behave like save as (#7025)Gravatar Krzysztof Czerwinski 9-16/+151
* Make `Agent.save_state` behave like "save as" - Leave previously saved state untouched - Save agent state in new folder corresponding to new `agent_id` - Copy over workspace contents to new folder * Add `copy` method to `FileStorage` --------- Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
2024-04-10fix(ci): Disable annoying "PR too big" auto-messageGravatar Reinier van der Leer 1-0/+1
2024-03-25fix(agent, forge): Conform web_search.py to duckduckgo_search v5 (#7046)Gravatar Krzysztof Czerwinski 4-39/+43
Update web_search command for both autogpt and forge to adjust for breaking change in v5 of duckduckgo_search, update duckduckgo_search to ^5.0.0 --------- Co-authored-by: Nicholas Tindle <nicholas.tindle@agpt.co>
2024-03-25fix(agent, forge): Conform `web_search.py` to `duckduckgo_search` v5 (#7045)Gravatar Krzysztof Czerwinski 4-6/+4
Update `web_search` command for both autogpt and forge to adjust for breaking change in v5 of `duckduckgo_search`
2024-03-22fix(agent): Fix type issue in test_s3_file_storage.pyGravatar Reinier van der Leer 1-1/+1
2024-03-22fix(agent): Fix check when loading an existing agent (#7026)Gravatar Krzysztof Czerwinski 1-2/+5
Now the check also ensures the chosen agent number is within proper range
2024-03-22security(agent): Replace unsafe `pyyaml` loader with `SafeLoader` (#7035)Gravatar Matheus Oliveira 7-7/+7
Co-authored-by: pixeebot[bot] <104101892+pixeebot[bot]@users.noreply.github.com>
2024-03-22ci(agent): Add macOS on M1 to AutoGPT CI matrix (#7041)Gravatar Reinier van der Leer 1-2/+2
Use a `macos-14` runner to cover macOS on M1/arm64 - Add `macos-arm64` to `platform-os` matrix, and map it to `macos-14` runner
2024-03-22ci(agent): Disable Python dependency caching on WindowsGravatar Reinier van der Leer 1-1/+3
On Windows, unpacking cached dependencies takes longer than just installing them with `poetry install`. :')
2024-03-22ci(agent): Fix Python dependency caching on macOSGravatar Reinier van der Leer 1-1/+1
2024-03-22fix(cli): Add timeout to `agent start` commandGravatar Reinier van der Leer 1-17/+36
- Add `timeout` parameter (default 30) to `wait_until_conn_ready(..)` function - Apply `isort` and `black` formatting
2024-03-22test(agent): Fix VCRpy request header filter for cross-platform cassette ↵Gravatar Reinier van der Leer 2-82/+58
reuse (#7040) - Move filtering logic from tests/vcr/__init__.py to tests/vcr/vcr_filter.py - Ignore all `X-Stainless-*` headers for cassette matching, e.g. `X-Stainless-OS` and `X-Stainless-Runtime-Version` - Remove deprecated OpenAI proxy logic - Reorder methods in vcr_filter.py for readability
2024-03-22ci(agent): Fix Docker CI for PR runs from forks (vol. 2)Gravatar Reinier van der Leer 1-1/+1
- Fix docker image tag format error when `secrets.DOCKER_USER` is not set
2024-03-22feat(autogpt): Handle OpenAI API key exceptions gracefully (#6992)Gravatar Krzysztof Czerwinski 3-34/+60
* Better handle no API keys or invalid ones * Handle exception and exit when invalid key is provided * Handle any APIError exception when trying to get OpenAI models and exit --------- Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
2024-03-22ci(agent): Fix Docker CI for PR runs from forksGravatar Reinier van der Leer 1-1/+2
- Disable 'Log in to Docker hub' step for `pull_request` runs
2024-03-22test(agent): Update VCRpy cassettesGravatar Reinier van der Leer 1-0/+0
Add new entries for `test_dalle`
2024-03-21ci(agent): Matrix CI tests across Linux, macOS and Windows (#7029)Gravatar Reinier van der Leer 2-18/+60
* Matrix the AutoGPT Python CI's `test` job across Ubuntu, macOS and Windows - Set up MinIO in a step rather than specifying it under `jobs[test].services`, because services are only supported on Linux runners - Add Windows version of step to install Poetry - Add macOS compatibility patches to 'Install Poetry (Unix)' and `setup_git_auth` steps **Caveats:** - **No Docker on macOS or Windows** * Windows comes with Docker but only supports running Windows containers, while we're mainly interested in using Linux containers for code execution and/or running auxiliary services. * [The macOS runner doesn't come with Docker](https://github.com/actions/runner-images/issues/17). Setting it up is possible but takes ~3-4 minutes, and the performance of the Colima engine is poor: a `docker pull` that takes 2 seconds on Linux takes 45 seconds on macOS. - **No S3 service available on Windows** It seems that running a background process [isn't possible on Windows](https://github.com/actions/runner/issues/598#issuecomment-2011890429), and neither is running Linux-based Docker containers. * Add `autogpt-agent` and OS-specific flags to Codecov upload step * Improve caching of Python dependencies in CI by changing the cache key - Include hash of `poetry.lock` instead of `pyproject.toml` in key - Remove date component from key; it was included to avoid getting stuck to old cached versions of packages when we were still using `requirements.txt`. With `poetry.lock` that is no longer a concern. * Fix skip check in test_s3_file_storage.py
2024-03-21feat(agent): Implement more fault tolerant `json_loads` function (#7016)Gravatar Krzysztof Czerwinski 15-103/+217
* 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-20fix(agent): Add check for Linux container support to `is_docker_available`Gravatar Reinier van der Leer 1-4/+5
2024-03-20fix(agent): Replace `PromptToolkit` with `click.prompt`Gravatar Reinier van der Leer 6-31/+24
- Replace `session.prompt_async(..)` with `click.prompt(..)` in `clean_input` (autogpt/app/utils.py) - Convert `clean_input` back to a synchronous function (and amend its usages accordingly) - Remove `prompt-toolkit` dependency This mitigates issues crashes in some shell environments on Windows.
2024-03-20feat(agent): Allow boolean values for `available` param on `@command`Gravatar Reinier van der Leer 2-3/+3
2024-03-20test(agent): Add skip statements to test_execute_code.py for when Docker is ↵Gravatar Reinier van der Leer 1-0/+9
not available
2024-03-20fix(agent): Windows-proof file_operationsGravatar Reinier van der Leer 1-4/+7
Make file_operations and test_file_operations behave more consistently between Unix and Windows
2024-03-20fix(agent): Fix and windows-proof `scan_plugins`Gravatar Reinier van der Leer 1-12/+11
- Improve error output for failure to load plugin - Fix logic to determine qualified module name - Use `importlib` rather than `__import__` magic function This unbreaks `scan_plugins` on Windows.
2024-03-20ci(docs): Fix Netlify build ignore checkGravatar Reinier van der Leer 1-1/+1
2024-03-18feat(autogpt/cli): Display info if code execution is enabled (#6997)Gravatar Krzysztof Czerwinski 1-0/+12
Display if code execution is enabled or not on CLI startup, depending if Docker is available.
2024-03-16feat(autogpt/cli): Check if port is available before running server (#6996)Gravatar Krzysztof Czerwinski 2-0/+19
2024-03-15fix(docs): Replace `polyfill.io` by Cloudflare mirror (#6952)Gravatar Sukka 1-1/+1
2024-03-15docs: Redirect AutoGPT users from Forge tutorial with warning (#7014)Gravatar Nicholas Tindle 1-0/+3
Update forge/get-started.md
2024-03-14fix(autogpt/cli): Loop until non-empty task is provided by the user (#6995)Gravatar Krzysztof Czerwinski 1-5/+8
2024-03-13lint(agent): Remove unused import in autogpt/agents/base.pyGravatar Reinier van der Leer 1-5/+1
2024-03-13fix(agent): Fix & improve agent self-termination and resumption mechanismGravatar Reinier van der Leer 5-37/+50
- Add `AgentFinished` exception (subclass of `AgentTerminated`) - Raise `AgentFinished` instead of `AgentTerminated` in `finish` method - Remove resumption patch from PR #6990 in `BaseAgent` - Clean up implementation of `finish` in `AgentProtocolServer` - Add resumption mechanism in `run_auto_gpt` (main.py)
2024-03-12fix(agent): Handle `action_history`-related exceptions gracefully (#6990)Gravatar Krzysztof Czerwinski 3-12/+26
Fix resume-related exceptions - CLI: prevent resumed agent to register action on already existing one - Server: prevent trying to json() command without result
2024-03-12feat(autogpt/forge): Send exception details in agent protocol endpoints (#7005)Gravatar Krzysztof Czerwinski 2-13/+112
Send exception details in agent protocol endpoints Co-authored-by: Nicholas Tindle <nicholas.tindle@agpt.co>
2024-03-12fix(autogpt): Fix GCS and S3 root path issue (#7010)Gravatar Krzysztof Czerwinski 2-2/+6
Fix root path issue
2024-03-11feat(agent): Fully abstracted file storage access with `FileStorage` (#6931)Gravatar Krzysztof Czerwinski 38-1343/+1677
* Rename `FileWorkspace` to `FileStorage` - `autogpt.file_workspace` -> `autogpt.file_storage` - `LocalFileWorkspace` -> `LocalFileStorage` - `S3FileWorkspace` -> `S3FileStorage` - `GCSFileWorkspace` -> `GCSFileStorage` * Rename `WORKSPACE_BACKEND` to `FILE_STORAGE_BACKEND` * Rename `WORKSPACE_STORAGE_BUCKET` to `STORAGE_BUCKET` * Rewrite `AgentManager` to use `FileStorage` rather than direct local file access * Rename `AgentManager.retrieve_state(..)` method to `load_agent_state` * Add docstrings to `AgentManager` * Create `AgentFileManagerMixin` to replace `AgentFileManager`, `FileWorkspaceMixin`, `BaseAgent.attach_fs(..)` * Replace `BaseAgentSettings.save_to_json_file(..)` method by `AgentFileManagerMixin.save_state()` * Replace `BaseAgent.set_id(..)` method by `AgentFileManagerMixin.change_agent_id(..)` * Remove `BaseAgentSettings.load_from_json_file(..)` * Remove `AgentSettings.agent_data_dir` * Update `AgentProtocolServer` to work with the new `FileStorage` system and `AgentFileManagerMixin` * Make `agent_id` and `file_storage` parameters for creating an Agent: - `create_agent`, `configure_agent_with_state`, `_configure_agent`, `create_agent_state` in `autogpt.agent_factory.configurators` - `generate_agent_for_task` in `autogpt.agent_factory.generators` - `Agent.__init__(..)` - `BaseAgent.__init__(..)` - Initialize and pass in `file_storage` in `autogpt.app.main.run_auto_gpt(..)` and `autogpt.app.main.run_auto_gpt_server(..)` * Add `clone_with_subroot` to `FileStorage` * Add `exists`, `make_dir`, `delete_dir`, `rename`, `list_files`, `list_folders` methods to `FileStorage` * Update `autogpt.commands.file_operations` to use `FileStorage` and `AgentFileManagerMixin` features * Update tests for `FileStorage` implementations and usages * Rename `workspace` fixture to `storage` * Update conftest.py
2024-03-09Create Security Policy (#6900)Gravatar Joyce 1-0/+66
* Create SECURITY.md Signed-off-by: Joyce <joycebrum@google.com> * Update SECURITY.md Signed-off-by: Joyce <joycebrum@google.com> * Update SECURITY.md Signed-off-by: Joyce <joycebrum@google.com> * Update SECURITY.md Signed-off-by: Joyce <joycebrum@google.com> --------- Signed-off-by: Joyce <joycebrum@google.com> Co-authored-by: Nicholas Tindle <nicholas.tindle@agpt.co>
2024-03-05Update QUICKSTART.mdGravatar Reinier van der Leer 1-27/+37
* Clarify instructions for entering the Arena * Clarify that entering the Arena is optional * Remove indent from top level content
2024-03-03Update README.mdGravatar Toran Bruce Richards 1-3/+7
Adds dark-theme support to star-history graph.
2024-03-01ci: Disable annoying auto-message discouraging big PRsGravatar Reinier van der Leer 1-3/+0
2024-03-01fix(ci/arena): Fix requesting manual reviewGravatar Reinier van der Leer 1-1/+2
Three times the charm, right?
2024-03-01fix(ci/arena): Fix requesting manual reviewGravatar Reinier van der Leer 1-1/+1
2024-03-01fix(ci/arena): Fix requesting manual reviewGravatar Reinier van der Leer 1-1/+1
2024-03-01fix(ci/arena): Skip checking file against itself for duplicatesGravatar Reinier van der Leer 1-6/+7
2024-03-01fix(ci/arena): Improve output formatGravatar Reinier van der Leer 1-5/+6
2024-03-01fix(ci/arena): Reverse check for `pr.mergeable`Gravatar Reinier van der Leer 1-2/+2
2024-03-01fix(ci/arena): Make check for `pr.mergeable` more specificGravatar Reinier van der Leer 1-1/+1