DataSage12 commited on
Commit
218be2f
·
1 Parent(s): 86bdc2c

Fix TTS URL handling: convert relative URLs to absolute URLs in Live Stream service

Browse files
Back-end/services/live_stream_service.py CHANGED
@@ -199,6 +199,11 @@ async def tts_node(state: ChatState) -> ChatState:
199
  audio_url = result.get("url")
200
  if not audio_url:
201
  raise RuntimeError("TTS no URL")
 
 
 
 
 
202
  async with session.get(audio_url) as audio_resp:
203
  if audio_resp.status != 200:
204
  raise RuntimeError(f"TTS file fetch error {audio_resp.status}")
 
199
  audio_url = result.get("url")
200
  if not audio_url:
201
  raise RuntimeError("TTS no URL")
202
+
203
+ # Construire l'URL complète si c'est une URL relative
204
+ if audio_url.startswith("/"):
205
+ audio_url = f"http://localhost:5000{audio_url}"
206
+
207
  async with session.get(audio_url) as audio_resp:
208
  if audio_resp.status != 200:
209
  raise RuntimeError(f"TTS file fetch error {audio_resp.status}")