From 2ec215c28837ed2583979a4e68e6b33c953c8bb9 Mon Sep 17 00:00:00 2001 From: Qingzheng Gao Date: Thu, 19 Oct 2023 00:35:33 +0800 Subject: [PATCH 1/2] [Feature] support line breaks --- main.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 56eba5aa..cf35b640 100644 --- a/main.py +++ b/main.py @@ -105,7 +105,20 @@ async def main(): # Commands to not get passed as input to MemGPT if user_input.startswith('/'): - if user_input.lower() == "/exit": + if user_input == "//": + 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": From 51fa71623a83ad1161be1f6bff691b9ac9ea7de7 Mon Sep 17 00:00:00 2001 From: Vivian Fang Date: Wed, 18 Oct 2023 13:06:14 -0700 Subject: [PATCH 2/2] documentation about multiline mode --- README.md | 2 ++ main.py | 1 + 2 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 2d0fbed1..6b6aa9fd 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/main.py b/main.py index cf35b640..797cdadb 100644 --- a/main.py +++ b/main.py @@ -106,6 +106,7 @@ async def main(): if user_input.startswith('/'): if user_input == "//": + print("Entering multiline mode, type // when done") user_input_list = [] while True: user_input = console.input("[bold cyan]>[/bold cyan] ")