File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -1209,6 +1209,7 @@ export class CallbackManager
1209
1209
} else {
1210
1210
callbackManager = inheritableHandlers ;
1211
1211
}
1212
+
1212
1213
callbackManager = callbackManager . copy (
1213
1214
Array . isArray ( localHandlers )
1214
1215
? localHandlers . map ( ensureHandler )
Original file line number Diff line number Diff line change @@ -192,7 +192,15 @@ export class LangChainTracer
192
192
193
193
static getTraceableRunTree ( ) : RunTree | undefined {
194
194
try {
195
- return getCurrentRunTree ( ) ;
195
+ return (
196
+ // The type cast here provides forward compatibility. Old versions of LangSmith will just
197
+ // ignore the permitAbsentRunTree arg.
198
+ (
199
+ getCurrentRunTree as (
200
+ permitAbsentRunTree : boolean
201
+ ) => ReturnType < typeof getCurrentRunTree > | undefined
202
+ ) ( true )
203
+ ) ;
196
204
} catch {
197
205
return undefined ;
198
206
}
You can’t perform that action at this time.
0 commit comments