Commit
·
c875274
1
Parent(s):
7e9ec18
Minor fix
Browse files- operators/chatgpt_op.py +1 -4
- operators/microphone_op.py +1 -1
- operators/whisper_op.py +0 -1
operators/chatgpt_op.py
CHANGED
@@ -15,7 +15,7 @@ def ask_gpt(prompt, raw):
|
|
15 |
)
|
16 |
|
17 |
response = client.chat.completions.create(
|
18 |
-
model="gpt-4-
|
19 |
messages=[
|
20 |
{"role": "system", "content": "You are a helpful assistant."},
|
21 |
{"role": "user", "content": prompt},
|
@@ -68,9 +68,6 @@ class Operator:
|
|
68 |
dora_event,
|
69 |
send_output,
|
70 |
) -> DoraStatus:
|
71 |
-
# todo: remove this
|
72 |
-
return DoraStatus.CONTINUE
|
73 |
-
|
74 |
if dora_event["type"] == "INPUT":
|
75 |
input = dora_event["value"][0].as_py()
|
76 |
with open(input["path"], "r", encoding="utf8") as f:
|
|
|
15 |
)
|
16 |
|
17 |
response = client.chat.completions.create(
|
18 |
+
model="gpt-4-turbo-preview",
|
19 |
messages=[
|
20 |
{"role": "system", "content": "You are a helpful assistant."},
|
21 |
{"role": "user", "content": prompt},
|
|
|
68 |
dora_event,
|
69 |
send_output,
|
70 |
) -> DoraStatus:
|
|
|
|
|
|
|
71 |
if dora_event["type"] == "INPUT":
|
72 |
input = dora_event["value"][0].as_py()
|
73 |
with open(input["path"], "r", encoding="utf8") as f:
|
operators/microphone_op.py
CHANGED
@@ -14,7 +14,7 @@ from dora import DoraStatus
|
|
14 |
|
15 |
# Set the parameters for recording
|
16 |
SAMPLE_RATE = 16000
|
17 |
-
MAX_DURATION =
|
18 |
|
19 |
|
20 |
class Operator:
|
|
|
14 |
|
15 |
# Set the parameters for recording
|
16 |
SAMPLE_RATE = 16000
|
17 |
+
MAX_DURATION = 5
|
18 |
|
19 |
|
20 |
class Operator:
|
operators/whisper_op.py
CHANGED
@@ -36,6 +36,5 @@ class Operator:
|
|
36 |
result = model.transcribe(audio, language="en")
|
37 |
text = result["text"]
|
38 |
print(text, flush=True)
|
39 |
-
text = "Can you set the RGB to blue?"
|
40 |
send_output("text", pa.array([text]), dora_event["metadata"])
|
41 |
return DoraStatus.CONTINUE
|
|
|
36 |
result = model.transcribe(audio, language="en")
|
37 |
text = result["text"]
|
38 |
print(text, flush=True)
|
|
|
39 |
send_output("text", pa.array([text]), dora_event["metadata"])
|
40 |
return DoraStatus.CONTINUE
|