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 codebase to forge
#7106
base: master
Are you sure you want to change the base?
refactor(agent, forge): Move codebase 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
PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here. PR Code Suggestions ✨
|
PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here. Changelog updates: 🔄 2024-05-07Added
Changed
Fixed
|
PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here. PR Analysis 🔬
💡 Usage guide:Using static code analysis capabilities, the The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR:
Language that are currently supported: Python, Java, C++, JavaScript, TypeScript, C#. |
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.
Very close
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.
thats suprising
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request. |
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.
Scary but cool
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.
NOPE, this file is specific to the AutoGPT app and should stay where it is.
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.
Without component-specific configs (which are out of scope) I need to pass settings as separate params to components. How about I keep this Config and make a derived class in autogpt
with only those settings that can be moved?
autogpts/forge/forge/json/schema.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.
misleading file name
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.
renamed to model.py
"file://localhost/", | ||
"file://localhost", | ||
"http://localhost", | ||
"http://localhost/", | ||
"https://localhost", | ||
"https://localhost/", | ||
"http://2130706433", | ||
"http://2130706433/", | ||
"https://2130706433", | ||
"https://2130706433/", | ||
"http://127.0.0.1/", | ||
"http://127.0.0.1", | ||
"https://127.0.0.1/", | ||
"https://127.0.0.1", | ||
"https://0.0.0.0/", | ||
"https://0.0.0.0", | ||
"http://0.0.0.0/", | ||
"http://0.0.0.0", | ||
"http://0000", | ||
"http://0000/", | ||
"https://0000", | ||
"https://0000/", |
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 disallows access to locally running applications, which is exactly why we removed these URLs from the filter before.
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.
Also out of scope
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.
Reverted
@@ -49,8 +49,8 @@ The easiest way to provide a command is to use `command` decorator on a componen | |||
|
|||
```py | |||
from autogpt.agents.components import Component | |||
from autogpt.agents.protocols import CommandProvider | |||
from autogpt.core.utils.json_schema import JSONSchema | |||
from forge.protocols import CommandProvider |
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.
Shouldn't this be forge.agent.protocols
?
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.
Fixed and reordered
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.
event_history.py -> event_history_component.py
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.
Done, only this +_component
how about other?
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.
yeet 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.
This would cascade into multiple changes including in Agent
which I think is out of scope. I moved it to autogpt/app/
and will remove in #7112
|
||
__all__ = [ | ||
"configure_logging", | ||
"user_friendly_output", | ||
"CURRENT_CONTEXT_FILE_NAME", | ||
"NEXT_ACTION_FILE_NAME", | ||
"PROMPT_SUMMARY_FILE_NAME", | ||
"PROMPT_SUPERVISOR_FEEDBACK_FILE_NAME", | ||
"SUMMARY_FILE_NAME", | ||
"SUPERVISOR_FEEDBACK_FILE_NAME", | ||
"USER_INPUT_FILE_NAME", | ||
"LogCycleHandler", | ||
] |
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.
?
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.
I restored this but do we need to explicitly set __all__
and if so, for every module? I think it's set automatically for members without _
prefix and also it's only useful when you use import *
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.
forge.processing
-> forge.content_processing
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.
Something called AutoGptFormatter
should either not be ported to forge or renamed
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.
Renamed to ForgeFormatter
Component agent docs should be moved to forge docs :) |
Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly. |
…inski/open-656-move-components-to-forge
User description
Background
Follow-up after Component-based Agents
The goal of this PR is to move reusable code (including components) to
forge
so AutoGPT agent is built usingforge
.forge
in pyprojectChanges 🏗️
The vast majority of changes are import updates, other are 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
and moved it toaction_history.py
(due to circular imports)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 couplingPR 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
.