-
Notifications
You must be signed in to change notification settings - Fork 44k
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
refactor(agent, forge): Move library code from autogpt
to forge
#7106
refactor(agent, forge): Move library code from autogpt
to forge
#7106
Conversation
✅ Deploy Preview for auto-gpt-docs canceled.
|
autogpts/forge/forge/sdk/utils.py
Outdated
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.
Moved to forge/utils/exceptions.py
autogpts/forge/forge/sdk/errors.py
Outdated
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.
Merged with exceptions from autogpt
into forge/utils/exceptions.py
forge
forge
@@ -32,21 +32,30 @@ class MyAgent(Agent): | |||
|
|||
## Ordering components | |||
|
|||
The execution order of components is important because the latter ones may depend on the results of the former ones. | |||
The execution order of components is important because some may depend on the results of the previous ones. | |||
**By default, components are ordered alphabetically.** |
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.
sidenote: We should probably resolve this in some other way down the line. Perhaps with a manifest and building a graph
def __init__( | ||
self, | ||
event_history: EpisodicActionHistory[AP], | ||
max_tokens: int, | ||
count_tokens: Callable[[str], int], | ||
legacy_config: Config, | ||
legacy_config: "Config", |
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.
nit: Do we need this?
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.
No, updated
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.
sidenote: why deleted? Behavior change?
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.
This was a leftover from my initial notes, I may put this back in some form when I update docs after the refactor.
There's no get_component
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.
few comments but all can be resolved without interaction from me so approving
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.
LGTM
@kcze Would you like me to force merge it in. Assuming your later PRs eventually fix the CI's |
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.
Sure, a minimal config in forge
would be useful.
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.
Thanks for addressing the earlier feedback! We're down to 6 unresolved items on my end (so excluding @ntindle's comments, and excluding one which doesn't require any changes) :)
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request. |
Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly. |
forge
autogpt
to forge
Background
The goal of this PR is to move reusable code (including components) to
forge
so AutoGPT agent is built usingforge
.Changes 🏗️
Modules moved from
autogpt
toforge
:autogpt.agents.base
autogpt.agents.components
autogpt.agents.protocols
forge.agent.base
forge.agent.components
forge.agent.protocols
autogpt.models.command
autogpt.command_decorator
autogpt.models.command_parameter
forge.command.command
forge.command.decorator
forge.command.parameter
autogpt.commands
autogpt.components
autogpt.agents.features
forge.components
{.action_history
,.code_executor
,.context
,.file_manager
,.git_operations
,.image_gen
,.system
,.user_interaction
,.watchdog
,.web.search
,.web.selenium
}autogpt.config
forge.config
{.config
,.ai_profile
,.ai_directives
}autogpt.processing
forge.content_processing
{.html
,.text
}autogpt.file_storage
forge.file_storage
{.base
,.gcs
,.local
,.s3
}autogpt.core.utils.json_utils
forge.json.parsing
autogpt.core.prompting.base
autogpt.core.prompting.schema
forge.llm.prompting.base
forge.llm.prompting.schema
autogpt.prompts.utils
forge.llm.prompting.utils
autogpt.core.resource.model_providers
forge.llm.providers
{.anthropic
,.multi
,.openai
}autogpt.llm.providers.openai
autogpt.core.resource.model_providers.utils
forge.llm.providers.utils
autogpt.logs
forge.logging
{.config
,.filters
,.formatters
,.handlers
,.helpers
,.utils
}autogpt.models.action_history:Action*
autogpt.core.configuration.schema
autogpt.core.utils.json_schema
autogpt.core.resource.schema
autogpt.models.utils
forge.models.action
forge.models.config
forge.models.json_schema
forge.models.providers
forge.models.utils
autogpt.speech
forge.speech
{.base
,.say
,.eleven_labs
,.gtts
,.macos_tts
,.stream_elements_speech
}autogpt.utils.exceptions
autogpt.utils.file_operations_utils
autogpt.url_utils.validators
autogpt.utils.utils
forge.utils.exceptions
forge.utils.file_operations
forge.utils.url_validator
forge.utils.const
forge.utils.yaml_validator
The rest are mostly import updates, and some sporadic removals and necessary updates (for example to fix circular deps):
CommandOutput = Any
to remove coupling withContextItem
(no longer needed)Singleton
classspeech
to forge due to coupling (tts needs to be changed into component)function_specs_from_commands
andcore/resource/model_providers
tollm/providers
(resources were acore
thing and are no longer relevant)autogpt
to reduce changes in this PRFancyConsoleFormatter
,BelowLevelFilter
prompt_settings.yaml
is in bothautogpt
andforge
because for some reason doesn't work when placed in just one dir (need to be taken care of)config
param fromclean_input
, it wasn't used and caused circular dependencyBaseAgentActionProposal
toActionProposal
pyproject.toml
inforge
andautogpt
Action*
models fromforge/components/action_history/model.py
toforge/models/action.py
as those are relevant to the entire agent and not justEventHistoryComponent
+ to reduce couplingDEFAULT_ASK_COMMAND
toASK_COMMAND
andDEFAULT_FINISH_COMMAND
toFINISH_COMMAND
AutoGptFormatter
toForgeFormatter
and moved toforge
PR Quality Scorecard ✨
+2 pts
+5 pts
+5 pts
+5 pts
-4 pts
+4 pts
+5 pts
-5 pts
agbenchmark
to verify that these changes do not regress performance?+10 pts
PR Type
enhancement, bug_fix
Description
forge/config/schema.py
to enhance system and user settings management.forge/utils/input.py
to streamline input handling and improve error management.event_history
module inforge/components/event_history/__init__.py
to better organize event-related classes and functions.forge/llm/providers/__init__.py
to include a new utility function, enhancing command specifications handling.forge/logging/__init__.py
.forge/sdk/__init__.py
, removing references to a non-existent errors module and adding necessary exception handling utilities.Changes walkthrough 📝
schema.py
Add Configuration Management Classes
autogpts/forge/forge/config/schema.py
SystemConfiguration
,SystemSettings
, andUserConfigurable
for configuration management.user-specific settings.
input.py
Implement User Input Handling Utility
autogpts/forge/forge/utils/input.py
clean_input
to handle user input witherror handling for keyboard interrupts.
__init__.py
Update LLM Providers Initialization
autogpts/forge/forge/llm/providers/init.py
function_specs_from_commands
.__init__.py
Enhance Logging Initialization with New Components
autogpts/forge/forge/logging/init.py
__init__.py
Initialize Event History Module
autogpts/forge/forge/components/event_history/init.py
event_history
module to manageaction proposals and results.
__init__.py
Correct SDK Initialization Imports
autogpts/forge/forge/sdk/init.py
errors
.