Skip to content

Commit f451243

Browse files
fix(closes OPEN-8768): langChain callback handler not using sessions and users
1 parent 2415888 commit f451243

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/openlayer/lib/integrations/langchain_callback.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,11 @@ def _process_and_upload_trace(self, trace: traces.Trace) -> None:
191191
)
192192
)
193193

194+
# Add reserved column configurations for user context
195+
if "user_id" in trace_data:
196+
config.update({"user_id_column_name": "user_id"})
197+
if "session_id" in trace_data:
198+
config.update({"session_id_column_name": "session_id"})
194199
if "groundTruth" in trace_data:
195200
config.update({"ground_truth_column_name": "groundTruth"})
196201
if "context" in trace_data:
@@ -1225,6 +1230,11 @@ def _process_and_upload_async_trace(self, trace: traces.Trace) -> None:
12251230
)
12261231
)
12271232

1233+
# Add reserved column configurations for user context
1234+
if "user_id" in trace_data:
1235+
config.update({"user_id_column_name": "user_id"})
1236+
if "session_id" in trace_data:
1237+
config.update({"session_id_column_name": "session_id"})
12281238
if "groundTruth" in trace_data:
12291239
config.update({"ground_truth_column_name": "groundTruth"})
12301240
if "context" in trace_data:

0 commit comments

Comments
 (0)