mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-22 08:38:13 +02:00
chore: update pipecat to 1.3.0 (#379)
* chore: rename PipelineTask to PipelineWorker * fix: fix tests * chore: update pipecat submodule * fix: fix anyio same task cancellation scope
This commit is contained in:
parent
e695436fb3
commit
5ef3be92b5
26 changed files with 170 additions and 132 deletions
|
|
@ -25,8 +25,7 @@ from unittest.mock import AsyncMock, patch
|
|||
import pytest
|
||||
from pipecat.frames.frames import Frame, LLMContextFrame
|
||||
from pipecat.pipeline.pipeline import Pipeline
|
||||
from pipecat.pipeline.runner import PipelineRunner
|
||||
from pipecat.pipeline.task import PipelineParams, PipelineTask
|
||||
from pipecat.pipeline.worker import PipelineParams, PipelineWorker
|
||||
from pipecat.processors.aggregators.llm_context import LLMContext
|
||||
from pipecat.processors.aggregators.llm_response_universal import (
|
||||
LLMAssistantAggregatorParams,
|
||||
|
|
@ -42,6 +41,7 @@ from pipecat.turns.user_mute import (
|
|||
from pipecat.utils.enums import EndTaskReason
|
||||
|
||||
from api.enums import ToolCategory
|
||||
from api.services.pipecat.worker_runner import run_pipeline_worker
|
||||
from api.services.workflow.dto import (
|
||||
EdgeDataDTO,
|
||||
EndCallNodeData,
|
||||
|
|
@ -112,7 +112,7 @@ async def create_engine_with_tracking(
|
|||
mock_llm: MockLLMService,
|
||||
test_helper: EndCallTestHelper,
|
||||
generate_audio: bool = True,
|
||||
) -> tuple[PipecatEngine, MockTTSService, MockTransport, PipelineTask]:
|
||||
) -> tuple[PipecatEngine, MockTTSService, MockTransport, PipelineWorker]:
|
||||
"""Create a PipecatEngine with tracking for end call behavior.
|
||||
|
||||
Args:
|
||||
|
|
@ -222,7 +222,7 @@ async def create_engine_with_tracking(
|
|||
)
|
||||
|
||||
# Create pipeline task
|
||||
task = PipelineTask(pipeline, params=PipelineParams(), enable_rtvi=False)
|
||||
task = PipelineWorker(pipeline, params=PipelineParams(), enable_rtvi=False)
|
||||
|
||||
engine.set_task(task)
|
||||
|
||||
|
|
@ -279,10 +279,9 @@ class TestEndCallViaNodeTransition:
|
|||
new_callable=AsyncMock,
|
||||
return_value={"user_intent": "end call"},
|
||||
):
|
||||
runner = PipelineRunner()
|
||||
|
||||
async def run_pipeline():
|
||||
await runner.run(task)
|
||||
await run_pipeline_worker(task)
|
||||
|
||||
async def initialize_engine():
|
||||
await asyncio.sleep(0.01)
|
||||
|
|
@ -383,10 +382,9 @@ class TestEndCallViaNodeTransition:
|
|||
new_callable=AsyncMock,
|
||||
return_value={"greeting_type": "formal", "user_name": "John"},
|
||||
):
|
||||
runner = PipelineRunner()
|
||||
|
||||
async def run_pipeline():
|
||||
await runner.run(task)
|
||||
await run_pipeline_worker(task)
|
||||
|
||||
async def initialize_engine():
|
||||
await asyncio.sleep(0.01)
|
||||
|
|
@ -482,10 +480,9 @@ class TestEndCallViaCustomTool:
|
|||
new_callable=AsyncMock,
|
||||
return_value={"user_intent": "end"},
|
||||
):
|
||||
runner = PipelineRunner()
|
||||
|
||||
async def run_pipeline():
|
||||
await runner.run(task)
|
||||
await run_pipeline_worker(task)
|
||||
|
||||
async def initialize_engine():
|
||||
await asyncio.sleep(0.01)
|
||||
|
|
@ -574,10 +571,9 @@ class TestEndCallViaCustomTool:
|
|||
new_callable=AsyncMock,
|
||||
return_value={"user_intent": "end"},
|
||||
):
|
||||
runner = PipelineRunner()
|
||||
|
||||
async def run_pipeline():
|
||||
await runner.run(task)
|
||||
await run_pipeline_worker(task)
|
||||
|
||||
async def initialize_engine():
|
||||
await asyncio.sleep(0.01)
|
||||
|
|
@ -652,10 +648,9 @@ class TestEndCallViaClientDisconnect:
|
|||
new_callable=AsyncMock,
|
||||
return_value={"user_intent": "disconnected"},
|
||||
):
|
||||
runner = PipelineRunner()
|
||||
|
||||
async def run_pipeline():
|
||||
await runner.run(task)
|
||||
await run_pipeline_worker(task)
|
||||
|
||||
async def initialize_and_disconnect():
|
||||
await asyncio.sleep(0.01)
|
||||
|
|
@ -743,10 +738,9 @@ class TestEndCallRaceConditions:
|
|||
new_callable=AsyncMock,
|
||||
return_value={"user_intent": "end"},
|
||||
):
|
||||
runner = PipelineRunner()
|
||||
|
||||
async def run_pipeline():
|
||||
await runner.run(task)
|
||||
await run_pipeline_worker(task)
|
||||
|
||||
async def initialize_and_race():
|
||||
await asyncio.sleep(0.01)
|
||||
|
|
@ -855,10 +849,9 @@ class TestEndCallRaceConditions:
|
|||
new_callable=AsyncMock,
|
||||
return_value={"user_intent": "end"},
|
||||
):
|
||||
runner = PipelineRunner()
|
||||
|
||||
async def run_pipeline():
|
||||
await runner.run(task)
|
||||
await run_pipeline_worker(task)
|
||||
|
||||
async def initialize_and_race_disconnect():
|
||||
nonlocal disconnect_called
|
||||
|
|
@ -950,10 +943,9 @@ class TestEndCallExtractionBehavior:
|
|||
"_perform_extraction",
|
||||
side_effect=mock_extraction,
|
||||
):
|
||||
runner = PipelineRunner()
|
||||
|
||||
async def run_pipeline():
|
||||
await runner.run(task)
|
||||
await run_pipeline_worker(task)
|
||||
|
||||
async def initialize_and_end():
|
||||
await asyncio.sleep(0.01)
|
||||
|
|
@ -1076,10 +1068,9 @@ class TestEndCallExtractionBehavior:
|
|||
"_perform_extraction",
|
||||
extraction_mock,
|
||||
):
|
||||
runner = PipelineRunner()
|
||||
|
||||
async def run_pipeline():
|
||||
await runner.run(task)
|
||||
await run_pipeline_worker(task)
|
||||
|
||||
async def initialize_and_end():
|
||||
await asyncio.sleep(0.01)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue