enclose text between brackets when logging
This commit is contained in:
@@ -119,7 +119,7 @@ class TextFrame(DataFrame):
|
||||
text: str
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.name}(text: {self.text})"
|
||||
return f"{self.name}(text: [{self.text}])"
|
||||
|
||||
|
||||
@dataclass
|
||||
@@ -132,7 +132,7 @@ class TranscriptionFrame(TextFrame):
|
||||
timestamp: str
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.name}(user_id: {self.user_id}, text: {self.text}, timestamp: {self.timestamp})"
|
||||
return f"{self.name}(user_id: {self.user_id}, text: [{self.text}], timestamp: {self.timestamp})"
|
||||
|
||||
|
||||
@dataclass
|
||||
@@ -143,7 +143,7 @@ class InterimTranscriptionFrame(TextFrame):
|
||||
timestamp: str
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.name}(user: {self.user_id}, text: {self.text}, timestamp: {self.timestamp})"
|
||||
return f"{self.name}(user: {self.user_id}, text: [{self.text}], timestamp: {self.timestamp})"
|
||||
|
||||
|
||||
@dataclass
|
||||
|
||||
@@ -66,7 +66,7 @@ class TTSService(AIService):
|
||||
else:
|
||||
self._current_sentence += frame.text
|
||||
if self._current_sentence.strip().endswith((".", "?", "!")):
|
||||
text = self._current_sentence
|
||||
text = self._current_sentence.strip()
|
||||
self._current_sentence = ""
|
||||
|
||||
if text:
|
||||
|
||||
@@ -32,7 +32,7 @@ class ElevenLabsTTSService(TTSService):
|
||||
self._model = model
|
||||
|
||||
async def run_tts(self, text: str) -> AsyncGenerator[Frame, None]:
|
||||
logger.debug(f"Transcribing text: {text}")
|
||||
logger.debug(f"Transcribing text: [{text}]")
|
||||
|
||||
url = f"https://api.elevenlabs.io/v1/text-to-speech/{self._voice_id}/stream"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user