1
0
Fork 0

Merging upstream version 1.15.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-03-17 07:31:48 +01:00
parent e6604cf449
commit d4dff17dce
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
10 changed files with 141 additions and 23 deletions

View file

@ -352,7 +352,10 @@ class LiteCli(object):
self.configure_pager()
self.refresh_completions()
history_file = config_location() + "history"
history_file = self.config["main"]["history_file"]
if history_file == "default":
history_file = config_location() + "history"
history_file = os.path.expanduser(history_file)
if dir_path_exists(history_file):
history = FileHistory(history_file)
else:
@ -441,13 +444,16 @@ class LiteCli(object):
self.echo(str(e), err=True, fg="red")
return
if special.is_llm_command(text):
while special.is_llm_command(text):
try:
start = time()
cur = self.sqlexecute.conn and self.sqlexecute.conn.cursor()
context, sql = special.handle_llm(text, cur)
context, sql, duration = special.handle_llm(text, cur)
if context:
click.echo("LLM Reponse:")
click.echo(context)
click.echo('---')
click.echo(f"Time: {duration:.2f} seconds")
text = self.prompt_app.prompt(default=sql)
except KeyboardInterrupt:
return