Tighten the pipeline_task contract for processors and tools

`FrameProcessorSetup.pipeline_task` is now mandatory and
`FrameProcessor.pipeline_task` raises if accessed before setup
instead of returning `None`. `FunctionCallParams` gains a
required `pipeline_task` field and `LLMService._run_function_call`
populates it (plus reads `app_resources` directly off the
pipeline task). Tests that build a processor or
`FunctionCallParams` outside a real pipeline stub it with a
`SimpleNamespace`.
This commit is contained in:
Aleix Conchillo Flaqué
2026-05-13 19:15:33 -07:00
parent 7d28c46a5d
commit ef806163b2
5 changed files with 38 additions and 45 deletions

View File

@@ -5,6 +5,7 @@
#
import unittest
from types import SimpleNamespace
from unittest.mock import AsyncMock, patch
from pipecat.adapters.base_llm_adapter import BaseLLMAdapter
@@ -45,6 +46,8 @@ class MockLLMService(LLMService):
user_turn_completion_config=None,
)
super().__init__(settings=settings, **kwargs)
# Stub the pipeline task so FunctionCallParams can be constructed.
self._pipeline_task = SimpleNamespace(app_resources=None)
class TestUnparameterizedSubclass(unittest.TestCase):