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

write_to_file arguments are printed on a single line, which is hard to read #2302

Closed
1 task done
feffy380 opened this issue Apr 18, 2023 · 8 comments
Closed
1 task done
Labels

Comments

@feffy380
Copy link

feffy380 commented Apr 18, 2023

Duplicates

  • 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.

@Qoyyuum Qoyyuum added the enhancement New feature or request label Apr 18, 2023
@ashuk2000
Copy link

#2421

@ntindle
Copy link
Member

ntindle commented Apr 20, 2023

Fixed by #2421

@z-x-x136
Copy link

由#2421修复

Can you print multiple lines by changing the code to f"ARGUMENTS = {Fore.CYAN} {arguments} {Style.RESET_ALL}"

@z-x-x136
Copy link

#2421

Can you print multiple lines by changing the code to f"ARGUMENTS = {Fore.CYAN} {arguments} {Style.RESET_ALL}"

@ashuk2000
Copy link

#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.

@Boostrix
Copy link
Contributor

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):
difflib-agpt

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
poc-agpt-ui

@Pwuts Pwuts moved this to 🔖 Promising in AutoGPT development kanban Jul 7, 2023
@Pwuts Pwuts moved this from 🔖 Promising to 📅 Milestoned (and in progress) in AutoGPT development kanban Jul 7, 2023
@Pwuts Pwuts added this to the v0.4.5 Release milestone Jul 7, 2023
@lc0rp lc0rp modified the milestones: v0.4.5 Release, v0.4.6 Release Jul 14, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2023

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.

@github-actions github-actions bot added the Stale label Sep 9, 2023
@Pwuts Pwuts moved this from ⏩ In Progress to 🔖 Valuable & Actionable in AutoGPT development kanban Sep 10, 2023
@github-actions
Copy link
Contributor

This issue was closed automatically because it has been stale for 10 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 20, 2023
@github-project-automation github-project-automation bot moved this from 🔖 Valuable & Actionable to ✅ Done in AutoGPT development kanban Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

8 participants