AutoGPT
AutoGPT copied to clipboard
write_to_file arguments are printed on a single line, which is hard to read
Duplicates
- [X] I have searched the existing issues
Summary 💡
When the current COMMAND is write_to_file (and possibly others), large multiline arguments should be printed as multiple lines for readability.
Examples 🌈
Current behavior:
NEXT ACTION: COMMAND = write_to_file ARGUMENTS = {'file': 'test.txt', 'text': 'Hello\nWorld'}
Expected behavior (or something similar):
NEXT ACTION: COMMAND = write_to_file
ARGUMENTS = {'file': 'test.txt', 'text':
Hello
World
}
Motivation 🔦
Currently, the arguments for NEXT ACTION are a simple json dump, which combines all the lines into a single long string. I'd like to be able to review what write_to_file is doing, which is difficult when the text isn't formatted.
https://github.com/Significant-Gravitas/Auto-GPT/pull/2421
Fixed by #2421
由#2421修复
Can you print multiple lines by changing the code to f"ARGUMENTS = {Fore.CYAN} {arguments} {Style.RESET_ALL}"
#2421
Can you print multiple lines by changing the code to f"ARGUMENTS = {Fore.CYAN} {arguments} {Style.RESET_ALL}"
#2421
Can you print multiple lines by changing the code to f"ARGUMENTS = {Fore.CYAN} {arguments} {Style.RESET_ALL}"
I think it can be done but the code won't be pretty. The problem is ,when python sees \n strings in a dictionary it replaces the new line \n with a literal \ and n in the f string. Maybe some kinda complex re split might do the trick.
FWIW, I think that should be easy to fix up - but not sure if it's important, there's probably more than just one UI in the pipeline anyway, so probably not a good idea to expend time/energy on cosmetics like these (?)
Admittedly, I did patch up the update_file work to visualize changes using a diff format though (#4079):
In general however, I think it's worth keeping in mind that there's going to be more than one frontend "soonish" (just look at the REST PR) - all these frontends will merely need the data, no need to bother with formatting etc.
Once the data is available, providing a UI on top of pretty straightforward.
#765
This issue has automatically been marked as stale because it has not had any activity in the last 50 days. You can unstale it by commenting or removing the label. Otherwise, this issue will be closed in 10 days.
This issue was closed automatically because it has been stale for 10 days with no activity.