Skip to content

Commit e1312af

Browse files
committed
fixed langfuse demo
1 parent b664b21 commit e1312af

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

examples/langfuse-demo/main.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,22 +201,24 @@ async def on_tool_start(
201201
async def on_tool_end(
202202
self,
203203
tool_name,
204+
input: Any,
204205
output: dict,
205206
run_id: Optional[UUID] = None,
206207
**kwargs: Any,
207208
) -> Any:
208209
langfuse_context.update_current_observation(
210+
input=input,
209211
name=tool_name,
210212
output=output
211213
)
212214

213215
@observe(as_type='generation', name='classify_request')
214-
async def classify_request(_orchestrator: MultiAgentOrchestrator, _user_input:str, _user_id:str, _session_id:str) -> ClassifierResult:
216+
async def classify_request(_orchestrator: AgentSquad, _user_input:str, _user_id:str, _session_id:str) -> ClassifierResult:
215217
result:ClassifierResult = await _orchestrator.classify_request(_user_input, _user_id, _session_id)
216218
return result
217219

218220
@observe(as_type='generation', name='agent_process_request')
219-
async def agent_process_request(_orchestrator: MultiAgentOrchestrator, user_input: str,
221+
async def agent_process_request(_orchestrator: AgentSquad, user_input: str,
220222
user_id: str,
221223
session_id: str,
222224
classifier_result: ClassifierResult,
@@ -248,7 +250,7 @@ async def agent_process_request(_orchestrator: MultiAgentOrchestrator, user_inpu
248250

249251

250252
@observe(as_type='generation', name='handle_request')
251-
async def handle_request(_orchestrator: MultiAgentOrchestrator, _user_input:str, _user_id:str, _session_id:str) -> str:
253+
async def handle_request(_orchestrator: AgentSquad, _user_input:str, _user_id:str, _session_id:str) -> str:
252254

253255
stream_response = True
254256
classification_result:ClassifierResult = await classify_request(_orchestrator, _user_input, _user_id, _session_id)
@@ -291,7 +293,7 @@ def run_main():
291293
callbacks=BedrockClassifierCallbacks()
292294
))
293295
# Initialize the orchestrator with some options
294-
orchestrator = MultiAgentOrchestrator(options=OrchestratorConfig(
296+
orchestrator = AgentSquad(options=AgentSquadConfig(
295297
LOG_AGENT_CHAT=True,
296298
LOG_CLASSIFIER_CHAT=True,
297299
LOG_CLASSIFIER_RAW_OUTPUT=True,
@@ -346,7 +348,7 @@ def run_main():
346348
user_inputs = []
347349
final_responses = []
348350

349-
print("Welcome to the interactive Multi-Agent system. Type 'quit' to exit.")
351+
print("Welcome to the interactive Agent-Squad system. Type 'quit' to exit.")
350352

351353
while True:
352354
# Get user input

0 commit comments

Comments
 (0)