mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-05 04:05:04 +00:00
cleaned up client refs
This commit is contained in:
parent
f1a31d3944
commit
c770fc4380
7 changed files with 16 additions and 30 deletions
|
@ -26,7 +26,7 @@ class Voice:
|
|||
|
||||
threshold = 0.15
|
||||
|
||||
def __init__(self, client):
|
||||
def __init__(self):
|
||||
if sf is None:
|
||||
raise SoundDeviceError
|
||||
try:
|
||||
|
@ -37,8 +37,6 @@ class Voice:
|
|||
except (OSError, ModuleNotFoundError):
|
||||
raise SoundDeviceError
|
||||
|
||||
self.client = client
|
||||
|
||||
def callback(self, indata, frames, time, status):
|
||||
"""This is called (from a separate thread) for each audio block."""
|
||||
rms = np.sqrt(np.mean(indata**2))
|
||||
|
@ -88,6 +86,7 @@ class Voice:
|
|||
while not self.q.empty():
|
||||
file.write(self.q.get())
|
||||
|
||||
# TODO: fix client!
|
||||
with open(filename, "rb") as fh:
|
||||
transcript = self.client.audio.transcriptions.create(
|
||||
model="whisper-1", file=fh, prompt=history, language=language
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue