mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-22 08:38:13 +02:00
chore: rename PipelineTask to PipelineWorker
This commit is contained in:
parent
e695436fb3
commit
dfb9fd80d2
20 changed files with 50 additions and 50 deletions
|
|
@ -21,7 +21,7 @@ from api.tasks.function_names import FunctionNames
|
|||
from pipecat.frames.frames import (
|
||||
Frame,
|
||||
)
|
||||
from pipecat.pipeline.task import PipelineTask
|
||||
from pipecat.pipeline.worker import PipelineWorker
|
||||
from pipecat.processors.audio.audio_buffer_processor import AudioBufferProcessor
|
||||
from pipecat.utils.enums import EndTaskReason
|
||||
|
||||
|
|
@ -58,7 +58,7 @@ async def _capture_call_event(
|
|||
|
||||
|
||||
def register_event_handlers(
|
||||
task: PipelineTask,
|
||||
task: PipelineWorker,
|
||||
transport,
|
||||
workflow_run_id: int,
|
||||
engine: PipecatEngine,
|
||||
|
|
@ -184,13 +184,13 @@ def register_event_handlers(
|
|||
)
|
||||
|
||||
@task.event_handler("on_pipeline_started")
|
||||
async def on_pipeline_started(_task: PipelineTask, _frame: Frame):
|
||||
async def on_pipeline_started(_task: PipelineWorker, _frame: Frame):
|
||||
logger.debug("In on_pipeline_started callback handler")
|
||||
ready_state["pipeline_started"] = True
|
||||
await maybe_trigger_initial_response()
|
||||
|
||||
@task.event_handler("on_pipeline_error")
|
||||
async def on_pipeline_error(_task: PipelineTask, frame: Frame):
|
||||
async def on_pipeline_error(_task: PipelineWorker, frame: Frame):
|
||||
logger.warning(f"Pipeline error for workflow run {workflow_run_id}: {frame}")
|
||||
try:
|
||||
workflow_run = await db_client.get_workflow_run_by_id(workflow_run_id)
|
||||
|
|
@ -218,7 +218,7 @@ def register_event_handlers(
|
|||
|
||||
@task.event_handler("on_pipeline_finished")
|
||||
async def on_pipeline_finished(
|
||||
task: PipelineTask,
|
||||
task: PipelineWorker,
|
||||
_frame: Frame,
|
||||
):
|
||||
logger.debug(f"In on_pipeline_finished callback handler")
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ from loguru import logger
|
|||
|
||||
from api.services.pipecat.audio_config import AudioConfig
|
||||
from pipecat.pipeline.pipeline import Pipeline
|
||||
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.audio.audio_buffer_processor import AudioBufferProcessor
|
||||
from pipecat.utils.run_context import turn_var
|
||||
|
|
@ -194,7 +194,7 @@ def create_pipeline_task(
|
|||
f"out: {audio_config.transport_out_sample_rate}Hz"
|
||||
)
|
||||
|
||||
task = PipelineTask(
|
||||
task = PipelineWorker(
|
||||
pipeline,
|
||||
params=pipeline_params,
|
||||
enable_tracing=True,
|
||||
|
|
|
|||
|
|
@ -61,7 +61,6 @@ from pipecat.audio.turn.smart_turn.local_smart_turn_v3 import LocalSmartTurnAnal
|
|||
from pipecat.audio.vad.silero import SileroVADAnalyzer
|
||||
from pipecat.audio.vad.vad_analyzer import VADParams
|
||||
from pipecat.extensions.voicemail.voicemail_detector import VoicemailDetector
|
||||
from pipecat.pipeline.base_task import PipelineTaskParams
|
||||
from pipecat.processors.aggregators.llm_response_universal import (
|
||||
LLMAssistantAggregatorParams,
|
||||
LLMContextAggregatorPair,
|
||||
|
|
@ -88,6 +87,7 @@ from pipecat.turns.user_stop import (
|
|||
from pipecat.turns.user_turn_strategies import UserTurnStrategies
|
||||
from pipecat.utils.enums import EndTaskReason, RealtimeFeedbackType
|
||||
from pipecat.utils.run_context import set_current_org_id, set_current_run_id
|
||||
from pipecat.workers.base_worker import WorkerParams
|
||||
|
||||
# Setup tracing if enabled
|
||||
ensure_tracing()
|
||||
|
|
@ -822,7 +822,7 @@ async def _run_pipeline(
|
|||
try:
|
||||
# Run the pipeline
|
||||
loop = asyncio.get_running_loop()
|
||||
params = PipelineTaskParams(loop=loop)
|
||||
params = WorkerParams(loop=loop)
|
||||
await task.run(params)
|
||||
logger.info(f"Task completed for run {workflow_run_id}")
|
||||
except asyncio.CancelledError:
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ from pipecat.frames.frames import (
|
|||
LLMContextFrame,
|
||||
TTSSpeakFrame,
|
||||
)
|
||||
from pipecat.pipeline.task import PipelineTask
|
||||
from pipecat.pipeline.worker import PipelineWorker
|
||||
from pipecat.processors.aggregators.llm_context import LLMContext
|
||||
from pipecat.services.llm_service import FunctionCallParams
|
||||
from pipecat.services.settings import LLMSettings
|
||||
|
|
@ -60,7 +60,7 @@ class PipecatEngine:
|
|||
def __init__(
|
||||
self,
|
||||
*,
|
||||
task: Optional[PipelineTask] = None,
|
||||
task: Optional[PipelineWorker] = None,
|
||||
llm: Optional["LLMService"] = None,
|
||||
inference_llm: Optional["LLMService"] = None,
|
||||
context: Optional[LLMContext] = None,
|
||||
|
|
@ -842,7 +842,7 @@ class PipecatEngine:
|
|||
"""
|
||||
self.context = context
|
||||
|
||||
def set_task(self, task: PipelineTask) -> None:
|
||||
def set_task(self, task: PipelineWorker) -> None:
|
||||
"""Set the pipeline task.
|
||||
|
||||
This allows setting the task after the engine has been created,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue