avoid mutable default constructor values

This commit is contained in:
Aleix Conchillo Flaqué
2025-05-20 11:59:04 -07:00
parent 462aecea3e
commit a09bd648af
51 changed files with 209 additions and 124 deletions

View File

@@ -4,11 +4,17 @@
# SPDX-License-Identifier: BSD 2-Clause License
#
from typing import Optional
from typing import Optional, Tuple, Type
from loguru import logger
from pipecat.frames.frames import AudioRawFrame, BotSpeakingFrame, Frame, TransportMessageFrame
from pipecat.frames.frames import (
BotSpeakingFrame,
Frame,
InputAudioRawFrame,
OutputAudioRawFrame,
TransportMessageFrame,
)
from pipecat.processors.frame_processor import FrameDirection, FrameProcessor
logger = logger.opt(ansi=True)
@@ -19,16 +25,17 @@ class FrameLogger(FrameProcessor):
self,
prefix="Frame",
color: Optional[str] = None,
ignored_frame_types: Optional[list] = [
ignored_frame_types: Tuple[Type[Frame], ...] = (
BotSpeakingFrame,
AudioRawFrame,
InputAudioRawFrame,
OutputAudioRawFrame,
TransportMessageFrame,
],
),
):
super().__init__()
self._prefix = prefix
self._color = color
self._ignored_frame_types = tuple(ignored_frame_types) if ignored_frame_types else None
self._ignored_frame_types = ignored_frame_types
async def process_frame(self, frame: Frame, direction: FrameDirection):
await super().process_frame(frame, direction)