Awaits all pending trace batches. Useful for environments where you need to be sure that all tracing requests finish before execution ends, such as serverless environments.
awaitPendingTraceBatches(): Promise<void>import { Client } from "langsmith";
const client = new Client();
try {
// Tracing happens here
...
} finally {
await client.awaitPendingTraceBatches();
}