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

Move app code to app subpackage. #4962

Conversation

collijk
Copy link
Contributor

@collijk collijk commented Jul 13, 2023

Background

One of the core Re-arch goals is to separate out Auto-GPT library code from application code. This is a first very crude push in that direction.

Changes

  • Moves several application modules under the autogpt.app namespace and makes corresponding import changes.
    • autogpt.cli -> autogpt.app.cli
    • autogpt.confugrator -> autogpt.app.configurator
    • autogpt.main -> autogpt.app.main
    • autogpt.prompts.prompt -> autogpt.app.prompt
    • autogpt.setup -> autogpt.app.setup
  • Moves the COMMAND_CATEGORIES global from autogpt.main to autogpt.commands.
  • Moves the DEFAULT_TRIGGERING_PROMPT from autogpt.prompts.prompt to autogpt.prompts.default_prompts
  • Removes the unused command_registry attribute from the AIConfig
  • Removes the unused, top-level main.py file.
  • Moves the construct_full_prompt method from the AIConfig to be a standalone function in autogpt.app.prompt, pushing the AIConfig towards being a relatively clean (with a little leftover cruft) data structure.

Documentation

X

Test Plan

CI with appropriate adjustments to test imports plus manual testing.

PR Quality Checklist

  • My pull request is atomic and focuses on a single change.
  • I have thoroughly tested my changes with multiple different prompts.
  • I have considered potential risks and mitigations for my changes.
  • I have documented my changes clearly and comprehensively.
  • I have not snuck in any "extra" small tweaks changes.
  • I have run the following commands against my code to ensure it passes our linters:
    black .
    isort .
    mypy
    autoflake --remove-all-unused-imports --recursive --ignore-init-module-imports --ignore-pass-after-docstring autogpt tests --in-place

@netlify
Copy link

netlify bot commented Jul 13, 2023

Deploy Preview for auto-gpt-docs canceled.

Name Link
🔨 Latest commit 69eb7b5
🔍 Latest deploy log https://app.netlify.com/sites/auto-gpt-docs/deploys/64b564b3676cdf0008e22f91

@codecov
Copy link

codecov bot commented Jul 13, 2023

Codecov Report

Patch coverage: 54.76% and project coverage change: -0.37 ⚠️

Comparison is base (5ae044f) 51.02% compared to head (69eb7b5) 50.65%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4962      +/-   ##
==========================================
- Coverage   51.02%   50.65%   -0.37%     
==========================================
  Files         118      119       +1     
  Lines        4898     4894       -4     
  Branches      649      648       -1     
==========================================
- Hits         2499     2479      -20     
- Misses       2215     2232      +17     
+ Partials      184      183       -1     
Impacted Files Coverage Δ
autogpt/__main__.py 0.00% <0.00%> (ø)
autogpt/app/cli.py 0.00% <0.00%> (ø)
autogpt/app/configurator.py 29.48% <ø> (ø)
autogpt/app/main.py 0.00% <0.00%> (ø)
autogpt/app/setup.py 73.07% <ø> (ø)
autogpt/app/prompt.py 45.45% <63.33%> (ø)
autogpt/commands/__init__.py 100.00% <100.00%> (ø)
autogpt/config/__init__.py 100.00% <100.00%> (ø)
autogpt/config/ai_config.py 100.00% <100.00%> (+22.95%) ⬆️
autogpt/prompts/default_prompts.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@Pwuts Pwuts added code quality ⬆️ PRs that improve code quality re-arch labels Jul 15, 2023
Copy link
Member

@Pwuts Pwuts Jul 17, 2023

Choose a reason for hiding this comment

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

Can/should this be moved to autogpt/prompts?

@github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label Jul 20, 2023
@github-actions
Copy link
Contributor

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

@collijk collijk closed this Jul 20, 2023
@collijk collijk deleted the refactor/move-app-code-to-app-package branch July 20, 2023 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality ⬆️ PRs that improve code quality conflicts Automatically applied to PRs with merge conflicts re-arch size/l
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants