Skip to content

Commit 8061db8

Browse files
committed
revert('ScenarioRunner`): convert to node
1 parent de67ecb commit 8061db8

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/rai/scenario_engine/scenario_engine.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,10 @@
1616
from langchain_core.runnables import RunnableConfig
1717
from langchain_core.tools import BaseTool
1818
from langfuse.callback import CallbackHandler
19-
from rclpy.node import Node
2019

2120
from rai.history_saver import HistorySaver
2221
from rai.scenario_engine.messages import AgentLoop, FutureAiMessage
2322
from rai.scenario_engine.tool_runner import run_requested_tools
24-
from rai.tools.ros.native import BaseRos2NativeTool
2523

2624
__all__ = [
2725
"ScenarioRunner",
@@ -64,7 +62,7 @@ def __call__(self, messages: Sequence[BaseMessage]):
6462
ScenarioType = Sequence[ScenarioPartType]
6563

6664

67-
class ScenarioRunner(Node):
65+
class ScenarioRunner:
6866
"""
6967
The ScenarioRunner class is responsible for running a given scenario. It iterates over the scenario and executes the
7068
actions defined in the scenario.
@@ -81,12 +79,8 @@ def __init__(
8179
log_usage: bool = True,
8280
use_cache: bool = False,
8381
):
84-
super().__init__(node_name="rai") # type: ignore
8582
self.scenario = scenario
8683
self.tools = tools
87-
for t in self.tools: # TODO(@boczekbartek): refactor to the method
88-
if isinstance(t, BaseRos2NativeTool):
89-
t.set_node(self)
9084
self.log_usage = log_usage
9185
self.llm = llm
9286
self.llm_type = llm_type
@@ -125,7 +119,6 @@ def __init__(
125119
tags=["scenario_runner"],
126120
)
127121
self.invoke_config["callbacks"] = [self.langfuse_handler]
128-
self.run()
129122

130123
def run(self):
131124
self.logger.info("Starting conversation.")

0 commit comments

Comments
 (0)