Add timestamp frames and include timestamps in the transcription event and frame

This commit is contained in:
Mark Backman
2024-12-14 11:03:08 -05:00
parent 77aeda36eb
commit dd2703317a
9 changed files with 155 additions and 50 deletions

View File

@@ -207,6 +207,20 @@ class InterimTranscriptionFrame(TextFrame):
return f"{self.name}(user: {self.user_id}, text: [{self.text}], language: {self.language}, timestamp: {self.timestamp})"
@dataclass
class OpenAILLMContextUserTimestampFrame(DataFrame):
"""Timestamp information for user message in LLM context."""
timestamp: str
@dataclass
class OpenAILLMContextAssistantTimestampFrame(DataFrame):
"""Timestamp information for assistant message in LLM context."""
timestamp: str
@dataclass
class TranscriptionMessage:
"""A message in a conversation transcript containing the role and content.