diff --git a/agixt/Agent.py b/agixt/Agent.py index 73fb05ff92b3..fd37c113fa79 100644 --- a/agixt/Agent.py +++ b/agixt/Agent.py @@ -29,6 +29,7 @@ import logging import json import numpy as np +import base64 import jwt import os import re @@ -631,7 +632,7 @@ async def text_to_speech(self, text: str): filename = f"{self.agent_id}_{timestamp}.wav" audio_path = os.path.join(self.working_directory, filename) with open(audio_path, "wb") as f: - f.write(tts_content) + f.write(base64.b64decode(tts_content)) agixt_uri = getenv("AGIXT_URI") output_url = f"{agixt_uri}/outputs/{self.agent_id}/{filename}" return output_url