mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 06:44:59 +00:00
pass the input history as a prompt to whisper
This commit is contained in:
parent
9815d14368
commit
b6b271b70c
3 changed files with 30 additions and 5 deletions
|
@ -442,7 +442,25 @@ class Commands:
|
|||
self.io.tool_error("Unable to import `sounddevice`, is portaudio installed?")
|
||||
return
|
||||
|
||||
text = v.record_and_transcribe()
|
||||
history_iter = self.io.get_input_history()
|
||||
|
||||
history = []
|
||||
size = 0
|
||||
for line in history_iter:
|
||||
if line.startswith("/"):
|
||||
continue
|
||||
if line in history:
|
||||
continue
|
||||
if size + len(line) > 1024:
|
||||
break
|
||||
size += len(line)
|
||||
history.append(line)
|
||||
|
||||
history.reverse()
|
||||
history = "\n".join(history)
|
||||
dump(history)
|
||||
|
||||
text = v.record_and_transcribe(history)
|
||||
if text:
|
||||
self.io.add_to_input_history(text)
|
||||
print()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue