16
16
from langchain_core .runnables import RunnableConfig
17
17
from langchain_core .tools import BaseTool
18
18
from langfuse .callback import CallbackHandler
19
- from rclpy .node import Node
20
19
21
20
from rai .history_saver import HistorySaver
22
21
from rai .scenario_engine .messages import AgentLoop , FutureAiMessage
23
22
from rai .scenario_engine .tool_runner import run_requested_tools
24
- from rai .tools .ros .native import BaseRos2NativeTool
25
23
26
24
__all__ = [
27
25
"ScenarioRunner" ,
@@ -64,7 +62,7 @@ def __call__(self, messages: Sequence[BaseMessage]):
64
62
ScenarioType = Sequence [ScenarioPartType ]
65
63
66
64
67
- class ScenarioRunner ( Node ) :
65
+ class ScenarioRunner :
68
66
"""
69
67
The ScenarioRunner class is responsible for running a given scenario. It iterates over the scenario and executes the
70
68
actions defined in the scenario.
@@ -81,12 +79,8 @@ def __init__(
81
79
log_usage : bool = True ,
82
80
use_cache : bool = False ,
83
81
):
84
- super ().__init__ (node_name = "rai" ) # type: ignore
85
82
self .scenario = scenario
86
83
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 )
90
84
self .log_usage = log_usage
91
85
self .llm = llm
92
86
self .llm_type = llm_type
@@ -125,7 +119,6 @@ def __init__(
125
119
tags = ["scenario_runner" ],
126
120
)
127
121
self .invoke_config ["callbacks" ] = [self .langfuse_handler ]
128
- self .run ()
129
122
130
123
def run (self ):
131
124
self .logger .info ("Starting conversation." )
0 commit comments