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

[Feature] support line breaks #30

Merged
merged 3 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ python main.py --human me.txt
While using MemGPT via the CLI you can run various commands:

```text
//
enter multiline input mode (type // again when done)
/exit
exit the CLI
/save
Expand Down
16 changes: 15 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,21 @@ async def main():
# Commands to not get passed as input to MemGPT
if user_input.startswith('/'):

if user_input.lower() == "/exit":
if user_input == "//":
print("Entering multiline mode, type // when done")
user_input_list = []
while True:
user_input = console.input("[bold cyan]>[/bold cyan] ")
clear_line()
if user_input == "//":
break
else:
user_input_list.append(user_input)

# pass multiline inputs to MemGPT
user_message = system.package_user_message("\n".join(user_input_list))

elif user_input.lower() == "/exit":
break

elif user_input.lower() == "/savechat":
Expand Down