Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
mattieruth committed Sep 19, 2024
1 parent dcabdf1 commit d84c4d7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 30 deletions.
26 changes: 4 additions & 22 deletions src/pipecat/frames/frames.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,7 @@ class VisionImageRawFrame(ImageRawFrame):

def __str__(self):
pts = format_pts(self.pts)
return f"{
self.name}(pts: {pts}, text: {
self.text}, size: {
self.size}, format: {
self.format})"
return f"{self.name}(pts: {pts}, text: {self.text}, size: {self.size}, format: {self.format})"


@dataclass
Expand All @@ -115,11 +111,7 @@ class UserImageRawFrame(ImageRawFrame):

def __str__(self):
pts = format_pts(self.pts)
return f"{
self.name}(pts: {pts}, user: {
self.user_id}, size: {
self.size}, format: {
self.format})"
return f"{self.name}(pts: {pts}, user: {self.user_id}, size: {self.size}, format: {self.format})"


@dataclass
Expand Down Expand Up @@ -160,12 +152,7 @@ class TranscriptionFrame(TextFrame):
language: Language | None = None

def __str__(self):
return f"{
self.name}(user: {
self.user_id}, text: {
self.text}, language: {
self.language}, timestamp: {
self.timestamp})"
return f"{self.name}(user: {self.user_id}, text: {self.text}, language: {self.language}, timestamp: {self.timestamp})"


@dataclass
Expand All @@ -177,12 +164,7 @@ class InterimTranscriptionFrame(TextFrame):
language: Language | None = None

def __str__(self):
return f"{
self.name}(user: {
self.user_id}, text: {
self.text}, language: {
self.language}, timestamp: {
self.timestamp})"
return f"{self.name}(user: {self.user_id}, text: {self.text}, language: {self.language}, timestamp: {self.timestamp})"


@dataclass
Expand Down
4 changes: 2 additions & 2 deletions src/pipecat/processors/frame_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ async def stop_processing_metrics(self):
return MetricsFrame(data=[processing])

async def start_llm_usage_metrics(self, tokens: LLMTokenUsage):
logger.debug(f"{self._processor_name()} prompt tokens: {
tokens.prompt_tokens}, completion tokens: {tokens.completion_tokens}")
logger.debug(
f"{self._processor_name()} prompt tokens: {tokens.prompt_tokens}, completion tokens: {tokens.completion_tokens}")
value = LLMUsageMetricsData(
processor=self._processor_name(),
model=self._model_name(),
Expand Down
5 changes: 1 addition & 4 deletions src/pipecat/services/deepgram.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,7 @@ async def run_tts(self, text: str) -> AsyncGenerator[Frame, None]:
logger.debug(f"Generating TTS: [{text}]")

base_url = self._base_url
request_url = f"{base_url}?model={
self._voice}&encoding={
self._encoding}&container=none&sample_rate={
self._sample_rate}"
request_url = f"{base_url}?model={self._voice}&encoding={self._encoding}&container=none&sample_rate={self._sample_rate}"
headers = {"authorization": f"token {self._api_key}"}
body = {"text": text}

Expand Down
3 changes: 1 addition & 2 deletions src/pipecat/services/elevenlabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,7 @@ async def _connect(self):
voice_id = self._voice_id
model = self.model_name
output_format = self._params.output_format
url = f"{
self._url}/v1/text-to-speech/{voice_id}/stream-input?model_id={model}&output_format={output_format}"
url = f"{self._url}/v1/text-to-speech/{voice_id}/stream-input?model_id={model}&output_format={output_format}"
self._websocket = await websockets.connect(url)
self._receive_task = self.get_event_loop().create_task(self._receive_task_handler())
self._keepalive_task = self.get_event_loop().create_task(self._keepalive_task_handler())
Expand Down

0 comments on commit d84c4d7

Please sign in to comment.