From 5cc8efe98f49b3aaeddf0c05b7827efda411a916 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Wed, 22 Nov 2023 16:55:46 -0800 Subject: [PATCH] readline support for llm chat, closes #355 --- llm/cli.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/llm/cli.py b/llm/cli.py index af37feb..3fa2ecc 100644 --- a/llm/cli.py +++ b/llm/cli.py @@ -28,6 +28,7 @@ from .plugins import pm import base64 import pathlib import pydantic +import readline from runpy import run_module import shutil import sqlite_utils @@ -340,6 +341,7 @@ def chat( """ Hold an ongoing chat with a model. """ + readline.parse_and_bind("") log_path = logs_db_path() (log_path.parent).mkdir(parents=True, exist_ok=True) db = sqlite_utils.Database(log_path)