Spaces:
Running
Running
Update src/ux_agent.py
Browse files- src/ux_agent.py +9 -6
src/ux_agent.py
CHANGED
|
@@ -217,12 +217,15 @@ class AgentUX:
|
|
| 217 |
transcription_result = self.input.transcribe(audio_path, language=language_code)
|
| 218 |
print(f"✅ Whisper Result: {transcription_result}")
|
| 219 |
transcribed_text = transcription_result[0]['text']
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
|
|
|
|
|
|
|
|
|
| 226 |
|
| 227 |
status_log += f"🗣️ Heard: '{transcribed_text}'\n\n"
|
| 228 |
|
|
|
|
| 217 |
transcription_result = self.input.transcribe(audio_path, language=language_code)
|
| 218 |
print(f"✅ Whisper Result: {transcription_result}")
|
| 219 |
transcribed_text = transcription_result[0]['text']
|
| 220 |
+
|
| 221 |
+
# Inside automated_pipeline:
|
| 222 |
+
if isinstance(transcription_result, list) and len(transcription_result) > 0:
|
| 223 |
+
# Extract just the text from the first entry
|
| 224 |
+
transcribed_text = transcription_result[0].get('text', str(transcription_result))
|
| 225 |
+
else:
|
| 226 |
+
transcribed_text = str(transcription_result)
|
| 227 |
+
else:
|
| 228 |
+
transcribed_text = "Audio Received."
|
| 229 |
|
| 230 |
status_log += f"🗣️ Heard: '{transcribed_text}'\n\n"
|
| 231 |
|