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

Optimizing Responsibilities of Class Objects #2367

Conversation

lengweiping1983
Copy link
Contributor

@lengweiping1983 lengweiping1983 commented Apr 18, 2023

Background

1. AIConfig and Prompt two classes has interdependence.

The construct_prompt function in prompt.py is to call the construct_full_prompt function of the AlConfig object,
And the construct_full_prompt function needs to call the get_prompt function in prompt.py.

2. variable assignment

I saw the code in the script of cli.py (called main.py yesterday), as follows:

        ai_name = ""
	
        other code ......	
        
        agent = Agent(
            ai_name=ai_name,
            memory=memory,
            full_message_history=full_message_history,

Where is the value of the ai_name variable obtained, it cannot be seen here.

So need Optimizing Responsibilities of Class Objects.

Changes

Optimizing Responsibilities of Class Objects:
AIConfig only config, not generate prompt.
Prompt is responsible generate prompt.
Setup script is responsible to get AIConfig (either from user input or from ai_settings_file).

Documentation

Test Plan

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

@github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label Apr 18, 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.

@github-actions github-actions bot removed the conflicts Automatically applied to PRs with merge conflicts label Apr 19, 2023
@github-actions
Copy link
Contributor

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

@github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label Apr 19, 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.

@github-actions github-actions bot removed the conflicts Automatically applied to PRs with merge conflicts label Apr 19, 2023
@github-actions
Copy link
Contributor

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

@github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label Apr 19, 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.

@github-actions
Copy link
Contributor

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

@github-actions github-actions bot added conflicts Automatically applied to PRs with merge conflicts and removed conflicts Automatically applied to PRs with merge conflicts labels Apr 19, 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.

@lengweiping1983
Copy link
Contributor Author

lengweiping1983 commented Apr 20, 2023

@nponeccop @BillSchumacher

The PR I optimized two days ago has conflicts again.
Just synchronized the code, saw a lot of changes, added command plugins, this function is very good.

However, it is still possible to perform the following optimizations:
a. Optimizing Responsibilities of Class Objects.

b. command_registry belongs to AIConfig and PromptGenerator, which can be optimized. AI Config would be better with only user input data.

c. There are two command lists,
1. PromptGenerator has a command list
2. The CommandRegistry has a command list.
It would be better to just need a list.

d. There are two command objects.
1. command.py Command
2. build_default_prompt_generator commands.
It would be better to only need a Command object.

e. PromptGenerator commands is list , dict will be better, query is faster.

f. Now there are many files involved in optimization, such as generator.py, prompt.py, ai_config.py, agent.py, app.py, cli.py My changes will conflicts.

If it is possible for me to optimize it, just let me know.

@p-i-
Copy link
Contributor

p-i- commented May 5, 2023

This is a mass message from the AutoGPT core team.
Our apologies for the ongoing delay in processing PRs.
This is because we are re-architecting the AutoGPT core!

For more details (and for infor on joining our Discord), please refer to:
https://github.com/Significant-Gravitas/Auto-GPT/wiki/Architecting

@Pwuts
Copy link
Member

Pwuts commented Jun 14, 2023

Thanks for submitting, this kind of clean-up is appreciated! A lot of similar work has been done since this PR was submitted, which has caused extensive conflicts with master. I have tried resolving them, but without luck. It's too much. :/

I'll close this pull request, although we would be happy to keep you involved. Feel free to submit pull requests again or bring existing ones to our attention. We are working to get to a balance between our capacity to process PRs and the rate at which we receive them.

@Pwuts Pwuts closed this Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conflicts Automatically applied to PRs with merge conflicts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants