-
Notifications
You must be signed in to change notification settings - Fork 44.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(agent): Abstract file storage access #6931
feat(agent): Abstract file storage access #6931
Conversation
Add list_folders(..) and update exists(..) to include for folders.
Merge AgentFileManager and FileWorkspaceMixin
Change multiple files to use FileManager and FileStorage
This PR exceeds the recommended size of 500 lines. Please make sure you are NOT addressing multiple issues with one PR. |
✅ Deploy Preview for auto-gpt-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
This PR exceeds the recommended size of 500 lines. Please make sure you are NOT addressing multiple issues with one PR. |
This PR exceeds the recommended size of 500 lines. Please make sure you are NOT addressing multiple issues with one PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a first XL pull request this looks very good! I do have a number of comments/requests but don't let that be a discouragement. :)
Questions:
- Have the added methods on
GCSFileStorage
andS3FileStorage
been tested? - How much of this has been end-to-end tested?
Code cleanup, import order, better naming.
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good and tests pass. LGTM!
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Fails to deploy to GCP:
|
This improvement abstracts file access across whole project, so that AutoGPT app/agents can use different backends (e.g. local, GCS, S3).
Fixes related issue: OPEN-103
Changes
WORKSPACE_BACKEND
toFILE_STORAGE_BACKEND
WORKSPACE_STORAGE_BUCKET
toSTORAGE_BUCKET
Rename
FileWorkspace
toFileStorage
autogpt.file_workspace
->autogpt.file_storage
LocalFileWorkspace
->LocalFileStorage
S3FileWorkspace
->S3FileStorage
GCSFileWorkspace
->GCSFileStorage
Add
FileStorage
methodclone_with_subroot
Add
FileStorage
methodsexists
,make_dir
,delete_dir
,rename
,list_files
,list_folders
Create
AgentFileManagerMixin
to replaceAgentFileManager
,FileWorkspaceMixin
,BaseAgent.attach_fs(..)
BaseAgentSettings.save_to_json_file(..)
method byAgentFileManagerMixin.save_state()
BaseAgent.set_id(..)
method byAgentFileManagerMixin.change_agent_id(..)
BaseAgentSettings.load_from_json_file(..)
AgentSettings.agent_data_dir
Updates across codebase to adjust for this change, such as replacing direct file access to use
FileStorage
insteadAgentManager
to useFileStorage
rather than direct local file accessAgentManager.retrieve_state(..)
method toload_agent_state
AgentManager
AgentProtocolServer
to work with the newFileStorage
system andAgentFileManagerMixin
autogpt.commands.file_operations
to useFileStorage
andAgentFileManagerMixin
featuresMake
agent_id
andfile_storage
parameters for creating an Agent:autogpt.agent_factory.configurators
:create_agent(..)
,configure_agent_with_state(..)
,_configure_agent(..)
,create_agent_state(..)
autogpt.agent_factory.generators
:generate_agent_for_task(..)
Agent.__init__(..)
BaseAgent.__init__(..)
file_storage
inautogpt.app.main.run_auto_gpt(..)
andautogpt.app.main.run_auto_gpt_server(..)
Update tests for
FileStorage
implementations and usagesRename
workspace
fixture tostorage