LANGSMITH_TRACING_BACKGROUND
to "false"
. This will cause your traced functions to wait for tracing to complete before returning.
await
the client.awaitPendingTraceBatches();
method.awaitPendingTraceBatches
alongside the traceable
method:
manualFlushMode: true
in your client like this:
client.flush()
like this before your serverless function closes:
.flush()
.