Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/pipecat_flows/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,21 @@ def __init__(
self._showed_deprecation_warning_for_transition_fields = False
self._showed_deprecation_warning_for_set_node = False

def switch_llm(self, llm: LLMService, context_aggregator: Any) -> None:
"""Switch to another llm and reset tools and nodes but keep state.

Args:
llm : LLM service instance (e.g., OpenAI, Anthropic)
context_aggregator: Context aggregator for updating user context
"""
self.llm = llm
self._context_aggregator = context_aggregator
self.action_manager = ActionManager(self.task, flow_manager=self)
self.adapter = create_adapter(llm)
self._pending_function_calls = 0
self.current_functions: Set[str] = set() # Track registered functions
self.current_node: Optional[str] = None

def _validate_transition_callback(self, name: str, callback: Any) -> None:
"""Validate a transition callback.

Expand Down