Create pipeline.py
Browse files- pipeline.py +13 -0
pipeline.py
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from stt import speech_to_text
|
| 2 |
+
from llm import ask_llm
|
| 3 |
+
from tts import text_to_speech
|
| 4 |
+
|
| 5 |
+
def voice_pipeline(audio):
|
| 6 |
+
|
| 7 |
+
user_text = speech_to_text(audio)
|
| 8 |
+
|
| 9 |
+
ai_text = ask_llm(user_text)
|
| 10 |
+
|
| 11 |
+
audio_output = text_to_speech(ai_text)
|
| 12 |
+
|
| 13 |
+
return user_text, ai_text, audio_output
|