diff options
| author | Martin Bielik <mx.bielik@gmail.com> | 2023-04-03 00:25:59 +0200 |
|---|---|---|
| committer | Martin Bielik <mx.bielik@gmail.com> | 2023-04-03 00:25:59 +0200 |
| commit | 4029d16d1fb58e56b7eb67bb037e9644838fef24 (patch) | |
| tree | 95f769dc00ed98f9916a926cff0cd2d4c3d6170d /py/chat.py | |
| parent | 923746952c3d4794343f0505f4a6389fb6926bdb (diff) | |
| download | vim-ai-4029d16d1fb58e56b7eb67bb037e9644838fef24.tar.gz | |
trim newlines from the prompt, fixes #5
Diffstat (limited to '')
| -rw-r--r-- | py/chat.py | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -30,6 +30,10 @@ if not messages: file_content = ">>> user\n\n" + file_content messages.append({"role": "user", "content": file_content }) +for message in messages: + # strip newlines from the content as it causes empty responses + message["content"] = message["content"].strip() + try: if messages[-1]["content"].strip(): vim.command("normal! Go\n<<< assistant\n\n") |