diff --git a/src/pipecat/frames/frames.py b/src/pipecat/frames/frames.py index 01c840a71..139857297 100644 --- a/src/pipecat/frames/frames.py +++ b/src/pipecat/frames/frames.py @@ -27,6 +27,7 @@ from typing import ( Tuple, ) +from pipecat.adapters.schemas.tools_schema import ToolsSchema from pipecat.audio.interruptions.base_interruption_strategy import BaseInterruptionStrategy from pipecat.audio.turn.smart_turn.base_smart_turn import SmartTurnParams from pipecat.audio.vad.vad_analyzer import VADParams @@ -36,7 +37,7 @@ from pipecat.utils.time import nanoseconds_to_str from pipecat.utils.utils import obj_count, obj_id if TYPE_CHECKING: - from pipecat.processors.aggregators.llm_context import LLMContext + from pipecat.processors.aggregators.llm_context import LLMContext, NotGiven from pipecat.processors.frame_processor import FrameProcessor @@ -576,7 +577,7 @@ class LLMSetToolsFrame(DataFrame): tools: List of tool/function definitions for the LLM. """ - tools: List[dict] + tools: List[dict] | ToolsSchema | "NotGiven" @dataclass diff --git a/src/pipecat/processors/aggregators/llm_response_universal.py b/src/pipecat/processors/aggregators/llm_response_universal.py index e84194b78..ad4eced64 100644 --- a/src/pipecat/processors/aggregators/llm_response_universal.py +++ b/src/pipecat/processors/aggregators/llm_response_universal.py @@ -18,6 +18,7 @@ from typing import Any, Dict, List, Literal, Optional, Set from loguru import logger +from pipecat.adapters.schemas.tools_schema import ToolsSchema from pipecat.audio.interruptions.base_interruption_strategy import BaseInterruptionStrategy from pipecat.audio.turn.smart_turn.base_smart_turn import SmartTurnParams from pipecat.audio.vad.vad_analyzer import VADParams @@ -57,6 +58,7 @@ from pipecat.processors.aggregators.llm_context import ( LLMContext, LLMContextMessage, LLMSpecificMessage, + NotGiven, ) from pipecat.processors.aggregators.llm_response import ( LLMAssistantAggregatorParams, @@ -148,7 +150,7 @@ class LLMContextAggregator(FrameProcessor): """ self._context.set_messages(messages) - def set_tools(self, tools: List): + def set_tools(self, tools: ToolsSchema | NotGiven): """Set tools in the context. Args: