File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
src/openlayer/lib/integrations Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -562,6 +562,11 @@ def _handle_chain_start(
562
562
if tags and "langsmith:hidden" in tags :
563
563
return
564
564
565
+ if chain_name == "LangGraph" and inputs .get ("messages" ):
566
+ inputs = {
567
+ "prompt" : inputs .get ("messages" ),
568
+ }
569
+
565
570
self ._start_step (
566
571
run_id = run_id ,
567
572
parent_run_id = parent_run_id ,
@@ -571,7 +576,6 @@ def _handle_chain_start(
571
576
metadata = {
572
577
"tags" : tags ,
573
578
"serialized" : serialized ,
574
- "is_chain" : True ,
575
579
** (metadata or {}),
576
580
** kwargs ,
577
581
},
@@ -607,6 +611,15 @@ def _handle_chain_end(
607
611
if current_trace :
608
612
current_trace .update_metadata (context = context_list )
609
613
614
+ # Parse output for LangGraph
615
+ step = self .steps [run_id ]
616
+ if step .name == "LangGraph" and outputs .get ("messages" ):
617
+ if isinstance (outputs .get ("messages" ), list ):
618
+ if isinstance (
619
+ outputs .get ("messages" )[- 1 ], langchain_schema .BaseMessage
620
+ ):
621
+ outputs = outputs .get ("messages" )[- 1 ].content
622
+
610
623
self ._end_step (
611
624
run_id = run_id ,
612
625
parent_run_id = parent_run_id ,
You can’t perform that action at this time.
0 commit comments