diff --git a/CHANGELOG.md b/CHANGELOG.md index e2ca4dce1..8df67e742 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added + +- Allow passing observers to `run_test()` while running unit tests. + ### Changed - `GoogleLLMService` has been updated to use `google-genai` instead of the diff --git a/src/pipecat/tests/utils.py b/src/pipecat/tests/utils.py index b5dfc5de1..3f5182044 100644 --- a/src/pipecat/tests/utils.py +++ b/src/pipecat/tests/utils.py @@ -6,7 +6,7 @@ import asyncio from dataclasses import dataclass -from typing import Any, Awaitable, Callable, Dict, Optional, Sequence, Tuple +from typing import Any, Awaitable, Callable, Dict, List, Optional, Sequence, Tuple from pipecat.frames.frames import ( EndFrame, @@ -79,6 +79,7 @@ async def run_test( expected_down_frames: Optional[Sequence[type]] = None, expected_up_frames: Optional[Sequence[type]] = None, ignore_start: bool = True, + observers: List[BaseObserver] = [], start_metadata: Dict[str, Any] = {}, send_end_frame: bool = True, ) -> Tuple[Sequence[Frame], Sequence[Frame]]: @@ -100,6 +101,7 @@ async def run_test( task = PipelineTask( pipeline, params=PipelineParams(start_metadata=start_metadata), + observers=observers, cancel_on_idle_timeout=False, )