feat: add default initial context variables

This commit is contained in:
Abhishek Kumar 2026-04-02 14:32:43 +05:30
parent f368fe5134
commit 96c90376c3
8 changed files with 112 additions and 19 deletions

View file

@ -47,7 +47,6 @@ from api.services.workflow.pipecat_engine_variable_extractor import (
from api.services.workflow.tools.knowledge_base import (
retrieve_from_knowledge_base,
)
from api.services.workflow.tools.timezone import get_current_time
from api.utils.template_renderer import render_template
@ -149,15 +148,6 @@ class PipecatEngine:
# Helper that encapsulates custom tool management
self._custom_tool_manager = CustomToolManager(self)
# Add current time in EST (America/New_York) to gathered context
try:
est_time_result = get_current_time("America/New_York")
# The get_current_time utility returns a dict with 'datetime' field
# Store the ISO formatted datetime string under the key 'time'
self._gathered_context["time"] = est_time_result.get("datetime")
except Exception as e:
logger.error(f"Failed to fetch current EST time: {e}")
await self.set_node(self.workflow.start_node_id)
logger.debug(f"{self.__class__.__name__} initialized")