-
Notifications
You must be signed in to change notification settings - Fork 45.7k
feat(autogpt_classic): Implement Flask web interface and enhance file operations #9725
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
Conversation
* **Add `autogpt/web_interface.py`**: Implement Flask web interface with routes for creating, listing, and deleting agents, and saving and retrieving information locally. * **Modify `autogpt/commands/file_operations.py`**: Update `write_to_file` and `read_file` functions to handle JSON and CSV formats. * **Update `autogpt/agent/agent_manager.py`**: Add methods for saving and retrieving agent information locally, and for listing and deleting agents. * **Change `autogpt/cli.py`**: Add command-line option to start the Flask web interface.
|
This PR targets the Automatically setting the base branch to |
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request. |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
Here's the code health analysis summary for commits Analysis Summary
|
❌ Deploy Preview for auto-gpt-docs failed.
|
Thanks for the changes! You've got a couple conflicts and a CLA that needs signed so it can't go in today's release. Ping me when these are resolved and I'll take a look :) |
@@ -128,12 +130,13 @@ def ingest_file( | |||
|
|||
|
|||
@command("write_to_file", "Write to file", '"filename": "<filename>", "text": "<text>"') | |||
def write_to_file(filename: str, text: str) -> str: | |||
def write_to_file(filename: str, text: str, format: str = "txt") -> str: |
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.
def write_to_file(filename: str, text: str, format: str = "txt") -> str: | |
def write_to_file(filename: str, text: str, format: Literal["txt", "json", "csv"] = "txt") -> str: |
if format == "json": | ||
with open(filename, "w", encoding="utf-8") as f: | ||
json.dump(text, f) | ||
elif format == "csv": | ||
with open(filename, "w", encoding="utf-8", newline='') as f: | ||
writer = csv.writer(f) | ||
writer.writerows(text) |
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.
This doesn't make a lot of sense since text
is explicitly typed as str
. I'd advise breaking this up into separate commands.
Closing for CLA poke us if you sign :) |
autogpt/web_interface.py
: Implement Flask web interface with routes for creating, listing, and deleting agents, and saving and retrieving information locally.autogpt/commands/file_operations.py
: Updatewrite_to_file
andread_file
functions to handle JSON and CSV formats.autogpt/agent/agent_manager.py
: Add methods for saving and retrieving agent information locally, and for listing and deleting agents.autogpt/cli.py
: Add command-line option to start the Flask web interface.Changes 🏗️
Checklist 📋
For code changes:
Example test plan
For configuration changes:
.env.example
is updated or already compatible with my changesdocker-compose.yml
is updated or already compatible with my changesExamples of configuration changes