-
Notifications
You must be signed in to change notification settings - Fork 43.1k
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(forge): Clean forge
#7117
refactor(forge): Clean forge
#7117
Conversation
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request. |
✅ Deploy Preview for auto-gpt-docs canceled.
|
PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here. PR Description updated to latest commit (1999bfb)
|
PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here. PR Review 🔍
|
PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here. PR Code Suggestions ✨
|
Default directives are now provided by the `SystemComponent`
(validated, message) = validate_yaml_file(prompt_settings_file) | ||
if not validated: | ||
logger.error(message, extra={"title": "FAILED FILE VALIDATION"}) | ||
request_user_double_check() |
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.
With this usage gone, iirc we can remove request_user_double_check
from forge
. Maybe it's still used in autogpt
but then it should be defined there.
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.
When I remove request_user_double_check
, then user_friendly_output
is also not used, so removing 🧹
Also moved print_attribute
and speak
to logging/utils.py
, so I could remove logging/helpers.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.
if user_friendly_output
is not used, then the typing_console_handler
and user_friendly_output_logger
also are not used afaik :)
User description
Background
Should be merged after:
autogpt
toforge
#7106Moveautogpt
andforge
to repo root #7151Follow-up after Component-based Agents
Changes 🏗️
TL;DR: remove unused
forge
code and improve structure offorge
.forge.agent_protocol
forge.agent_protocol.database
(wasforge.db
)forge
forge.actions
, containing old commands; replaced byforge.components
fromautogpt
forge/agent.py
(the old one,ForgeAgent
)forge/app.py
, which was used to serve and run theForgeAgent
forge/db.py
(ForgeDatabase
), which was used forForgeAgent
forge/llm.py
, which has been replaced by newforge.llm
module which was ported fromautogpt.core.resource.model_providers
forge.memory
, which is not in use and not being maintainedforge.sdk
, much of which was moved into other modules and the rest is deprecatedAccessDeniedError
: unusedforge_log.py
: replaced withlogging
validate_yaml_file
: not neededai_settings_file
and associated loading logic and env varAI_SETTINGS_FILE
: unusedprompt_settings_file
and associated loading logic and env varPROMPT_SETTINGS_FILE
: default directives are now provided by theSystemComponent
request_user_double_check
, which was only used inAIDirectives.load
TypingConsoleHandler
: not usedPR 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, tests
Description
forge
module to improve structure and remove unused code.forge.agent_protocol
.forge.actions
,forge/agent.py
,forge/app.py
,forge/db.py
,forge/llm.py
,forge/memory
,forge/sdk
,AccessDeniedError
,forge_log.py
, andvalidate_yaml_file
.logging
module.Changes walkthrough 📝
13 files
agent_protocol_server.py
Refactor imports and remove unused validation in
agent_protocol_server
.autogpts/autogpt/autogpt/app/agent_protocol_server.py
validate_yaml_file
.configurator.py
Remove YAML validation and update imports in `configurator`.
autogpts/autogpt/autogpt/app/configurator.py
main.py
Update import paths and remove redundant import in `main`.
autogpts/autogpt/autogpt/app/main.py
AgentDB
.utils.py
Remove YAML validation function in `utils`.
autogpts/autogpt/autogpt/app/utils.py
validate_yaml_file
import and related function.__main__.py
Replace custom logger with standard logging in `__main__.py`.
autogpts/forge/forge/main.py
logging
.api_router.py
Update imports and replace custom logger in `api_router`.
autogpts/forge/forge/agent_protocol/api_router.py
logging
.db.py
Update imports and replace custom logger in `db`.
autogpts/forge/forge/agent_protocol/database/db.py
logging
.task.py
Refactor models and rename `Status` to `StepStatus`.
autogpts/forge/forge/agent_protocol/models/task.py
Artifact
andPagination
models to separate files.Status
toStepStatus
.middlewares.py
Simplify import statements in `middlewares`.
autogpts/forge/forge/agent_protocol/middlewares.py
parameter.py
Replace `dataclasses` with `pydantic.BaseModel` in `parameter`.
autogpts/forge/forge/command/parameter.py
dataclasses
withpydantic.BaseModel
.code_executor.py
Add `CodeExecutionError` class in `code_executor`.
autogpts/forge/forge/components/code_executor/code_executor.py
CodeExecutionError
class.ai_directives.py
Remove YAML validation logic in `ai_directives`.
autogpts/forge/forge/config/ai_directives.py
ai_profile.py
Remove YAML file handling methods in `ai_profile`.
autogpts/forge/forge/config/ai_profile.py
2 files
test_ai_profile.py
Remove `AIProfile` related test cases.
autogpts/autogpt/tests/unit/test_ai_profile.py
AIProfile
class.test_utils.py
Remove `validate_yaml_file` test cases.
autogpts/autogpt/tests/unit/test_utils.py
validate_yaml_file
.