-
Notifications
You must be signed in to change notification settings - Fork 44.4k
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): Update component ordering #7148
feat(agent): Update component ordering #7148
Conversation
✅ 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 (ffd6377)
|
PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here. PR Review 🔍
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #7148 +/- ##
==========================================
- Coverage 44.68% 44.07% -0.62%
==========================================
Files 133 133
Lines 6315 6319 +4
Branches 823 825 +2
==========================================
- Hits 2822 2785 -37
- Misses 3382 3424 +42
+ Partials 111 110 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
…7106) Moved from `autogpt` to `forge`: - `autogpt.config` -> `forge.config` - `autogpt.processing` -> `forge.content_processing` - `autogpt.file_storage` -> `forge.file_storage` - `autogpt.logs` -> `forge.logging` - `autogpt.speech` -> `forge.speech` - `autogpt.agents.(base|components|protocols)` -> `forge.agent.*` - `autogpt.command_decorator` -> `forge.command.decorator` - `autogpt.models.(command|command_parameter)` -> `forge.command.(command|parameter)` - `autogpt.(commands|components|features)` -> `forge.components` - `autogpt.core.utils.json_utils` -> `forge.json.parsing` - `autogpt.prompts.utils` -> `forge.llm.prompting.utils` - `autogpt.core.prompting.(base|schema|utils)` -> `forge.llm.prompting.*` - `autogpt.core.resource.model_providers` -> `forge.llm.providers` - `autogpt.llm.providers.openai` + `autogpt.core.resource.model_providers.utils` -> `forge.llm.providers.utils` - `autogpt.models.action_history:Action*` -> `forge.models.action` - `autogpt.core.configuration.schema` -> `forge.models.config` - `autogpt.core.utils.json_schema` -> `forge.models.json_schema` - `autogpt.core.resource.schema` -> `forge.models.providers` - `autogpt.models.utils` -> `forge.models.utils` - `forge.sdk.(errors|utils)` + `autogpt.utils.(exceptions|file_operations_utils|validators)` -> `forge.utils.(exceptions|file_operations|url_validator)` - `autogpt.utils.utils` -> `forge.utils.const` + `forge.utils.yaml_validator` Moved within `forge`: - forge/prompts/* -> forge/llm/prompting/* The rest are mostly import updates, and some sporadic removals and necessary updates (for example to fix circular deps): - Changed `CommandOutput = Any` to remove coupling with `ContextItem` (no longer needed) - Removed unused `Singleton` class - Reluctantly moved `speech` to forge due to coupling (tts needs to be changed into component) - Moved `function_specs_from_commands` and `core/resource/model_providers` to `llm/providers` (resources were a `core` thing and are no longer relevant) - Keep tests in `autogpt` to reduce changes in this PR - Removed unused memory-related code from tests - Removed duplicated classes: `FancyConsoleFormatter`, `BelowLevelFilter` - `prompt_settings.yaml` is in both `autogpt` and `forge` because for some reason doesn't work when placed in just one dir (need to be taken care of) - Removed `config` param from `clean_input`, it wasn't used and caused circular dependency - Renamed `BaseAgentActionProposal` to `ActionProposal` - Updated `pyproject.toml` in `forge` and `autogpt` - Moved `Action*` models from `forge/components/action_history/model.py` to `forge/models/action.py` as those are relevant to the entire agent and not just `EventHistoryComponent` + to reduce coupling - Renamed `DEFAULT_ASK_COMMAND` to `ASK_COMMAND` and `DEFAULT_FINISH_COMMAND` to `FINISH_COMMAND` - Renamed `AutoGptFormatter` to `ForgeFormatter` and moved to `forge` Includes changes from PR #7148 --------- Co-authored-by: Reinier van der Leer <pwuts@agpt.co>
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request. |
User description
Merged with #7106
Background
Refactor #7106 is causing many problems with circular imports.
Static
run_after
inside component classes needlessely couples components to each other and hides ordering from the developer. And it's only useful for internal components as the exact type needs to be known.Changes 🏗️
Removed usage of static
run_after
field and introducedrun_after
method that allows defining ordering at the agent level (local & clear). This also allows user to order specific components (without defining order for all components).run_after
method inComponentAgent
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, Documentation
Description
run_after
method to replace static ordering in components, enhancing flexibility and clarity in component execution order.agent.py
to use the new dynamicrun_after
method forWatchdogComponent
andContextComponent
.run_after
lists fromWatchdogComponent
andEventHistoryComponent
.README.md
updated to guide on using the new dynamic ordering method and to warn about potential circular dependencies.Changes walkthrough 📝
agent.py
Implement dynamic component ordering in Agent initialization
autogpts/autogpt/autogpt/agents/agent.py
run_after
with dynamicrun_after
method calls forWatchdogComponent
andContextComponent
.base.py
Refine component collection and fix comment typo
autogpts/autogpt/autogpt/agents/base.py
components.py
Add dynamic ordering method to AgentComponent
autogpts/autogpt/autogpt/agents/components.py
run_after
method to dynamically set component execution order.run_after
list.watchdog.py
Remove static ordering from WatchdogComponent
autogpts/autogpt/autogpt/agents/features/watchdog.py
run_after
list fromWatchdogComponent
.event_history.py
Remove static ordering from EventHistoryComponent
autogpts/autogpt/autogpt/components/event_history.py
run_after
list fromEventHistoryComponent
.README.md
Update README to document dynamic component ordering
autogpts/autogpt/autogpt/commands/README.md