Skip to content
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

Open
wants to merge 33 commits into
base: master
Choose a base branch
from

Conversation

kcze
Copy link
Contributor

@kcze kcze commented Apr 25, 2024

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 using forge.

  • Test properly
  • Check pyproject deps
  • Revert local ref to forge in pyproject

Changes 🏗️

The vast majority of changes are import updates, other are 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 memory-related code from tests (unused anyway)
  • 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 and moved it to action_history.py (due to circular imports)
  • 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

PR Quality Scorecard ✨

  • Have you used the PR description template?   +2 pts
  • Is your pull request atomic, focusing on a single change?   +5 pts
  • Have you linked the GitHub issue(s) that this PR addresses?   +5 pts
  • Have you documented your changes clearly and comprehensively?   +5 pts
  • Have you changed or added a feature?   -4 pts
    • Have you added/updated corresponding documentation?   +4 pts
    • Have you added/updated corresponding integration tests?   +5 pts
  • Have you changed the behavior of AutoGPT?   -5 pts
    • Have you also run agbenchmark to verify that these changes do not regress performance?   +10 pts

PR Type

enhancement, bug_fix


Description

  • Introduced new configuration management classes in forge/config/schema.py to enhance system and user settings management.
  • Developed a new user input utility function in forge/utils/input.py to streamline input handling and improve error management.
  • Initialized the event_history module in forge/components/event_history/__init__.py to better organize event-related classes and functions.
  • Updated the LLM providers initialization in forge/llm/providers/__init__.py to include a new utility function, enhancing command specifications handling.
  • Enhanced the logging system by integrating new filters and formatters in forge/logging/__init__.py.
  • Fixed incorrect imports in the SDK initialization file forge/sdk/__init__.py, removing references to a non-existent errors module and adding necessary exception handling utilities.

Changes walkthrough 📝

Relevant files
Enhancement
schema.py
Add Configuration Management Classes                                         

autogpts/forge/forge/config/schema.py

  • Added new classes SystemConfiguration, SystemSettings, and
    UserConfigurable for configuration management.
  • These classes support the configuration of system-wide settings and
    user-specific settings.
  • +352/-1 
    input.py
    Implement User Input Handling Utility                                       

    autogpts/forge/forge/utils/input.py

  • Added a new utility function clean_input to handle user input with
    error handling for keyboard interrupts.
  • +19/-0   
    __init__.py
    Update LLM Providers Initialization                                           

    autogpts/forge/forge/llm/providers/init.py

  • Updated imports to include new utility function
    function_specs_from_commands.
  • +2/-0     
    __init__.py
    Enhance Logging Initialization with New Components             

    autogpts/forge/forge/logging/init.py

    • Added imports for new logging filters and formatters.
    +2/-13   
    Configuration changes
    __init__.py
    Initialize Event History Module                                                   

    autogpts/forge/forge/components/event_history/init.py

  • Created an initialization file for the event_history module to manage
    action proposals and results.
  • +10/-0   
    Bug_fix
    __init__.py
    Correct SDK Initialization Imports                                             

    autogpts/forge/forge/sdk/init.py

  • Removed erroneous import of deleted module errors.
  • Added import for exception handling utilities.
  • +2/-2     

    💡 PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    @github-actions github-actions bot added conflicts Automatically applied to PRs with merge conflicts documentation Improvements or additions to documentation AutoGPT Agent Forge size/xl labels Apr 25, 2024
    Copy link

    netlify bot commented Apr 25, 2024

    Deploy Preview for auto-gpt-docs canceled.

    Name Link
    🔨 Latest commit 6c1e8a3
    🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/6640a44752aca100088e6d41

    Copy link
    Contributor Author

    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

    Copy link
    Contributor Author

    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

    @github-actions github-actions bot removed the conflicts Automatically applied to PRs with merge conflicts label Apr 28, 2024
    @github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label Apr 29, 2024
    @kcze kcze mentioned this pull request May 1, 2024
    9 tasks
    @kcze kcze changed the title clean(autogpt, forge): Move codebase to forge refactor(autogpt, forge): Move codebase to forge May 1, 2024
    @github-actions github-actions bot removed the conflicts Automatically applied to PRs with merge conflicts label May 2, 2024
    @Significant-Gravitas Significant-Gravitas deleted a comment from github-actions bot May 2, 2024
    Copy link

    PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here.

    PR Code Suggestions ✨

    CategorySuggestions                                                                                                                                                       
    Best practice
    Replace mutable default arguments with safer alternatives.

    Replace the mutable default argument {} with None and initialize it inside the function to
    avoid potential bugs related to mutable default arguments.

    autogpts/forge/forge/config/schema.py [99]

    -def build_agent_configuration(cls, overrides: dict = {}) -> S:
    +def build_agent_configuration(cls, overrides: Optional[dict] = None) -> S:
    +    if overrides is None:
    +        overrides = {}
     
    Use isinstance() for type checks to support inheritance.

    Replace the use of type() with isinstance() for checking object types, which is more
    idiomatic and supports inheritance.

    autogpts/forge/forge/config/schema.py [56]

    -if type(from_env) is str else from_env()
    +if isinstance(from_env, str) else from_env()
     
    Ensure files are properly closed by using context management in file operations.

    Use context management for file operations to ensure that files are properly closed after
    operations, preventing resource leaks.

    autogpts/forge/forge/file_storage/local.py [52]

    -file = open(full_path, mode)  # type: ignore
    -return file
    +with open(full_path, mode) as file:  # type: ignore
    +    return file
     
    Specify file encoding explicitly when opening files to handle different system encodings.

    To ensure that the json_loads function handles different encodings properly, explicitly
    specify the encoding when opening files. This avoids issues with systems where the default
    encoding is not UTF-8.

    autogpts/forge/forge/agent/base.py [37-38]

    -with open(ai_settings_file, encoding="utf-8") as file:
    +with open(ai_settings_file, mode='r', encoding="utf-8") as file:
         config_params = yaml.load(file, Loader=yaml.SafeLoader) or {}
     
    Improve import specificity for better code clarity and to avoid conflicts.

    Consider using a more specific import statement for ActionProposal to avoid potential
    conflicts and improve code clarity. Instead of importing ActionProposal directly under a
    generic module path, specify the exact module where ActionProposal is defined.

    autogpts/autogpt/autogpt/agents/prompt_strategies/one_shot.py [9]

    -from forge.agent.base import ActionProposal
    +from forge.agent.base.action_proposal import ActionProposal
     
    Enhancement
    Improve exception handling by catching specific error types.

    Use a more specific exception handling instead of catching a general ValidationError. This
    will make the error handling more precise and informative.

    autogpts/forge/forge/config/schema.py [140-144]

     except ValidationError as e:
    +    if all(e["type"] == "value_error.missing" for e in e.errors()):
    +        return None
    +    elif all(e["type"] == "type_error" for e in e.errors()):
    +        # Handle type errors specifically
    +        pass
    +    else:
    +        raise
     
    Add error handling around input functions to manage exceptions and maintain robustness.

    Add error handling for the clean_input function to manage exceptions or invalid inputs
    effectively.

    autogpts/autogpt/autogpt/app/main.py [201]

    -answer = clean_input("Resume? [Y/n]")
    +try:
    +    answer = clean_input("Resume? [Y/n]")
    +except ValueError as e:
    +    logger.error(f"Invalid input: {e}")
    +    continue  # or handle appropriately
     
    Use a custom exception for JSON parsing errors to enhance error clarity and robustness.

    Consider using a more specific exception than ValueError when handling JSON parsing errors
    in json_loads. A custom exception like JSONParsingError could provide clearer error
    handling and make the codebase more robust.

    autogpts/forge/forge/agent/base.py [43-45]

    -raise ValueError(
    +raise JSONParsingError(
         f"Failed to parse JSON string: {json_str}", *json_result.errors
     )
     
    Use a more descriptive name for the thoughts variable to enhance code readability and clarity.

    Consider using a more descriptive variable or type name than thoughts to clarify its
    purpose and contents, especially if it holds complex data structures or important business
    logic.

    autogpts/autogpt/autogpt/agents/prompt_strategies/one_shot.py [46]

    -thoughts: AssistantThoughts
    +assistantThoughts: AssistantThoughts  # More descriptive, indicating the specific type of thoughts
     
    Maintainability
    Improve variable naming for better code readability.

    Use a more explicit variable name than SC to improve code readability and maintainability.

    autogpts/forge/forge/config/schema.py [70]

    -SC = TypeVar("SC", bound=SystemConfiguration)
    +SystemConfigType = TypeVar("SystemConfigType", bound=SystemConfiguration)
     
    Refactor repeated regex patterns into a shared constant to reduce duplication and improve maintainability.

    To improve the maintainability and readability of the code, consider refactoring the
    repeated regex pattern used in extract_dict_from_json and extract_list_from_json into a
    shared constant. This will reduce duplication and make future changes easier.

    autogpts/forge/forge/agent/base.py [52]

    -pattern = r"```(?:json|JSON)*([\s\S]*?)```"
    +JSON_CODE_BLOCK_PATTERN = r"```(?:json|JSON)*([\s\S]*?)```"
    +# Use the constant in the functions
    +pattern = JSON_CODE_BLOCK_PATTERN
     
    Consolidate imports from the same module into a single line for clarity and reduced verbosity.

    Since AssistantChatMessage, ChatMessage, and CompletionModelFunction are related and
    imported from the same module, consider using a single line import to reduce verbosity and
    improve readability.

    autogpts/autogpt/autogpt/agents/prompt_strategies/one_shot.py [15-19]

    -from forge.llm.providers.schema import (
    -    AssistantChatMessage,
    -    ChatMessage,
    -    CompletionModelFunction,
    -)
    +from forge.llm.providers.schema import AssistantChatMessage, ChatMessage, CompletionModelFunction
     
    Bug
    Correct a typo in the dictionary key.

    Correct the typo in the dictionary key from 'minumum' to 'minimum'.

    autogpts/forge/forge/json/schema.py [51]

    -schema["minumum"] = self.minimum
    +schema["minimum"] = self.minimum
     
    Ensure input handling respects specific configurations by passing the configuration context.

    Replace the direct use of clean_input with a version that includes configuration context
    to ensure that any specific configurations related to input handling are respected.

    autogpts/autogpt/autogpt/app/main.py [174-176]

     load_existing_agent = clean_input(
    +    config,
         "Enter the number or name of the agent to run,"
         " or hit enter to create a new one:"
     )
     
    Prevent unintended behavior by checking for non-empty input before loading agent state.

    Implement a check to ensure the answer variable is not empty before proceeding to load the
    agent state, to prevent unintended behavior.

    autogpts/autogpt/autogpt/app/main.py [202-203]

    -if answer == "" or answer.lower() == "y":
    +if answer.strip() and answer.lower() == "y":
         agent_state = agent_manager.load_agent_state(load_existing_agent)
     
    Ensure that AssistantThoughts is properly defined or imported to avoid runtime errors.

    To avoid potential runtime errors, ensure that the AssistantThoughts class or type is
    properly defined or imported in the current module, as it is used in the
    OneShotAgentActionProposal class.

    autogpts/autogpt/autogpt/agents/prompt_strategies/one_shot.py [46]

    +from forge.thoughts import AssistantThoughts  # Assuming the correct import path
     class OneShotAgentActionProposal(ActionProposal):
         thoughts: AssistantThoughts
     
    Security
    Enhance security by using yaml.safe_load for YAML file operations.

    Replace the direct use of yaml.load with yaml.safe_load to avoid potential security risks
    associated with loading arbitrary YAML content.

    autogpts/forge/forge/utils/file_operations.py [71]

    -data = yaml.load(file, Loader=yaml.SafeLoader)
    +data = yaml.safe_load(file)
     
    Reliability
    Replace assert with error handling in production code to ensure reliability.

    Replace the use of assert for checking json_result in production code with a more robust
    error handling strategy. Assertions can be disabled in some Python execution environments,
    leading to potential bugs.

    autogpts/forge/forge/agent/base.py [35]

    -assert json_result is not None  # by virtue of return_errors=True
    +if json_result is None:
    +    raise JSONParsingError("No result returned from JSON parsing.")
     
    Performance
    Optimize character stripping in AIProfile.load using regex for better performance.

    Use a more efficient method for stripping characters in AIProfile.load. Instead of using
    multiple replace calls, consider using a regex substitution which can handle all
    replacements in one pass.

    autogpts/forge/forge/agent/base.py [44-49]

    +import re
     ai_goals = [
    -    str(goal).strip("{}").replace("'", "").replace('"', "")
    +    re.sub(r"[{}'"]", "", str(goal))
         if isinstance(goal, dict)
         else str(goal)
         for goal in config_params.get("ai_goals", [])
     ]
     
    Possible issue
    Ensure that the new class definition includes all necessary methods and properties from the base class.

    To ensure that the OneShotAgentActionProposal class is correctly integrated into the new
    forge framework, verify that all methods and properties from the BaseAgentActionProposal
    (from the old codebase) are either implemented or intentionally omitted in the new class
    definition.

    autogpts/autogpt/autogpt/agents/prompt_strategies/one_shot.py [45-46]

     class OneShotAgentActionProposal(ActionProposal):
    +    # Ensure all necessary methods and properties are included
         thoughts: AssistantThoughts
    +    # Add other methods and properties as needed
     

    Copy link

    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-07

    Added

    • Introduced new JSON and schema configuration files in forge.
    • Added new logging filters and formatters to forge.

    Changed

    • Refactored codebase to move reusable components and utilities from autogpt to forge.
    • Updated various imports and configurations to align with the new forge structure.
    • Moved tests related to moved components to forge.

    Fixed

    • Addressed circular dependencies arising from the refactor.
    • Resolved issues with environment variable configurations in forge.

    to commit the new content to the CHANGELOG.md file, please type:
    '/update_changelog --pr_update_changelog.push_changelog_changes=true'

    Copy link

    PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here.

    PR Analysis 🔬

    • This screen contains a list of code components that were changed in this PR.
    • You can initiate specific actions for each component, by checking the relevant boxes.
    • After you check a box, the action will be performed automatically by PR-Agent.
    • Results will appear as a comment on the PR, typically after 30-60 seconds.
    fileChanged components
    one_shot.py
    • Test
    • Docs
    • Improve
    • Similar
     
    OneShotAgentActionProposal
    (class)
     
    +2/-2
     
    configurator.py
    • Test
    • Docs
    • Improve
    • Similar
     
    apply_overrides_to_config
    (function)
     
    +3/-3
     
    main.py
    • Test
    • Docs
    • Improve
    • Similar
     
    run_auto_gpt
    (function)
     
    +3/-6
     
    • Test
    • Docs
    • Improve
    • Similar
     
    update_user
    (function)
     
    +2/-2
     
    • Test
    • Docs
    • Improve
    • Similar
     
    get_user_feedback
    (function)
     
    +2/-2
     
    setup.py
    • Test
    • Docs
    • Improve
    • Similar
     
    interactively_revise_ai_settings
    (function)
     
    +4/-12
     
    simple.py
    • Test
    • Docs
    • Improve
    • Similar
     
    SimpleAgent
    (class)
     
    +2/-4
     
    conftest.py
    • Test
    • Docs
    • Improve
    • Similar
     
    memory_item
    (function)
     
    +10/-0
     
    test_config.py
    • Test
    • Docs
    • Improve
    • Similar
     
    test_create_config_gpt4only
    (function)
     
    +2/-2
     
    • Test
    • Docs
    • Improve
    • Similar
     
    test_create_config_gpt3only
    (function)
     
    +2/-2
     
    test_web_search.py
    • Test
    • Docs
    • Improve
    • Similar
     
    test_google_search
    (function)
     
    +2/-2
     
    base.py
    • Test
    • Docs
    • Improve
    • Similar
     
    propose_action
    (method of BaseAgent)
     
    +2/-0
     
    • Test
    • Docs
    • Improve
    • Similar
     
    execute
    (method of BaseAgent)
     
    +6/-0
     
    • Test
    • Docs
    • Improve
    • Similar
     
    do_not_execute
    (method of BaseAgent)
     
    +6/-0
     
    • Test
    • Docs
    • Improve
    • Similar
     
    run_pipeline
    (method of BaseAgent)
     
    +75/-0
     
    components.py
    • Test
    • Docs
    • Improve
    • Similar
     
    AgentComponent
    (class)
     
    +14/-0
     
    • Test
    • Docs
    • Improve
    • Similar
     
    ComponentEndpointError
    (class)
     
    +6/-0
     
    • Test
    • Docs
    • Improve
    • Similar
     
    EndpointPipelineError
    (class)
     
    +2/-0
     
    • Test
    • Docs
    • Improve
    • Similar
     
    ComponentSystemError
    (class)
     
    +3/-0
     
    protocols.py
    • Test
    • Docs
    • Improve
    • Similar
     
    after_parse
    (method of AfterParse)
     
    +2/-0
     
    action_history.py
    • Test
    • Docs
    • Improve
    • Similar
     
    ActionProposal
    (class)
     
    +3/-0
     
    user_interaction.py
    • Test
    • Docs
    • Improve
    • Similar
     
    ask_user
    (function)
     
    +6/-0
     
    watchdog.py
    • Test
    • Docs
    • Improve
    • Similar
     
    __init__
    (method of WatchdogComponent)
     
    +8/-0
     
    • Test
    • Docs
    • Improve
    • Similar
     
    after_parse
    (method of WatchdogComponent)
     
    +32/-0
     
    ai_directives.py
    • Test
    • Docs
    • Improve
    • Similar
     
    from_file
    (method of AIDirectives)
     
    +17/-0
     
    ai_profile.py
    • Test
    • Docs
    • Improve
    • Similar
     
    AIProfile
    (class)
     
    +62/-0
     
    config.py
    • Test
    • Docs
    • Improve
    • Similar
     
    assert_config_has_openai_api_key
    (function)
     
    +45/-0
     
    schema.py
    • Test
    • Docs
    • Improve
    • Similar
     
    UserConfigurable
    (function)
     
    +18/-0
     
    • Test
    • Docs
    • Improve
    • Similar
     
    SystemConfiguration
    (class)
     
    +34/-0
     
    • Test
    • Docs
    • Improve
    • Similar
     
    SystemSettings
    (class)
     
    +10/-0
     

    💡 Usage guide:

    Using static code analysis capabilities, the analyze tool scans the PR code changes and find the code components (methods, functions, classes) that changed in the PR.

    The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR:

    /analyze
    

    Language that are currently supported: Python, Java, C++, JavaScript, TypeScript, C#.
    See more information about the tool in the docs.

    Copy link
    Member

    @ntindle ntindle left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Very close

    autogpts/autogpt/autogpt/app/main.py Show resolved Hide resolved
    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    thats suprising

    autogpts/forge/forge/command/command.py Show resolved Hide resolved
    autogpts/forge/forge/utils/const.py Outdated Show resolved Hide resolved
    autogpts/forge/prompt_settings.yaml Show resolved Hide resolved
    Copy link

    github-actions bot commented May 9, 2024

    This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

    @github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label May 9, 2024
    @Significant-Gravitas Significant-Gravitas deleted a comment from github-actions bot May 9, 2024
    @Significant-Gravitas Significant-Gravitas deleted a comment from github-actions bot May 9, 2024
    @Significant-Gravitas Significant-Gravitas deleted a comment from github-actions bot May 9, 2024
    @Significant-Gravitas Significant-Gravitas deleted a comment from github-actions bot May 9, 2024
    Copy link
    Member

    @Pwuts Pwuts left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Scary but cool

    Copy link
    Member

    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.

    Copy link
    Contributor Author

    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?

    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    misleading file name

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    renamed to model.py

    Comment on lines 87 to 108
    "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/",
    Copy link
    Member

    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.

    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Also out of scope

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Reverted

    docs/content/AutoGPT/components/protocols.md Outdated Show resolved Hide resolved
    @@ -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
    Copy link
    Member

    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?

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Fixed and reordered

    Copy link
    Member

    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

    Copy link
    Contributor Author

    @kcze kcze May 10, 2024

    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?

    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    yeet this

    Copy link
    Contributor Author

    @kcze kcze May 10, 2024

    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

    Comment on lines 13 to 25

    __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",
    ]
    Copy link
    Member

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    ?

    Copy link
    Contributor Author

    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 *

    Copy link
    Member

    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

    Copy link
    Member

    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

    Copy link
    Contributor Author

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Renamed to ForgeFormatter

    @github-actions github-actions bot added the documentation Improvements or additions to documentation label May 9, 2024
    @Pwuts
    Copy link
    Member

    Pwuts commented May 10, 2024

    Component agent docs should be moved to forge docs :)

    ntindle
    ntindle previously approved these changes May 10, 2024
    @github-actions github-actions bot removed the conflicts Automatically applied to PRs with merge conflicts label May 10, 2024
    Copy link

    Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

    @kcze kcze requested a review from Pwuts May 11, 2024 09:39
    @kcze kcze linked an issue May 12, 2024 that may be closed by this pull request
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    Projects
    Status: 🚧 Needs work
    Development

    Successfully merging this pull request may close these issues.

    Port autogpt.core.resource.model_provider from AutoGPT to Forge
    3 participants