From d8a68da9e6d46c75eddcb9163561df6c0120a9cf Mon Sep 17 00:00:00 2001 From: William FH <13333726+hinthornw@users.noreply.github.com> Date: Wed, 7 Feb 2024 11:42:24 -0800 Subject: [PATCH] JS autobatch off (#410) --- js/package.json | 2 +- js/src/client.ts | 2 +- js/src/index.ts | 2 +- js/src/tests/batch_client.test.ts | 16 +++++++++++++--- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/js/package.json b/js/package.json index d2d08883f..ad72d9095 100644 --- a/js/package.json +++ b/js/package.json @@ -1,6 +1,6 @@ { "name": "langsmith", - "version": "0.0.67", + "version": "0.0.68", "description": "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform.", "packageManager": "yarn@1.22.19", "files": [ diff --git a/js/src/client.ts b/js/src/client.ts index 07ddbd108..b650642c0 100644 --- a/js/src/client.ts +++ b/js/src/client.ts @@ -240,7 +240,7 @@ export class Client { private sampledPostUuids = new Set(); - private autoBatchTracing = true; + private autoBatchTracing = false; private pendingAutoBatchedRuns: AutoBatchQueueItem[] = []; diff --git a/js/src/index.ts b/js/src/index.ts index 10e7aec78..79b99b853 100644 --- a/js/src/index.ts +++ b/js/src/index.ts @@ -5,4 +5,4 @@ export { Dataset, Example, TracerSession, Run, Feedback } from "./schemas.js"; export { RunTree, RunTreeConfig } from "./run_trees.js"; // Update using yarn bump-version -export const __version__ = "0.0.67"; +export const __version__ = "0.0.68"; diff --git a/js/src/tests/batch_client.test.ts b/js/src/tests/batch_client.test.ts index 48c4e7f06..36dab304f 100644 --- a/js/src/tests/batch_client.test.ts +++ b/js/src/tests/batch_client.test.ts @@ -5,7 +5,10 @@ import { convertToDottedOrderFormat } from "../run_trees.js"; describe("Batch client tracing", () => { it("should create a batched run with the given input", async () => { - const client = new Client({ apiKey: "test-api-key" }); + const client = new Client({ + apiKey: "test-api-key", + autoBatchTracing: true, + }); const callSpy = jest .spyOn((client as any).caller, "call") .mockResolvedValue({ @@ -55,7 +58,10 @@ describe("Batch client tracing", () => { }); it("Create + update batching should merge into a single call", async () => { - const client = new Client({ apiKey: "test-api-key" }); + const client = new Client({ + apiKey: "test-api-key", + autoBatchTracing: true, + }); const callSpy = jest .spyOn((client as any).caller, "call") .mockResolvedValue({ @@ -118,7 +124,10 @@ describe("Batch client tracing", () => { }); it("should create an example with the given input and generation", async () => { - const client = new Client({ apiKey: "test-api-key" }); + const client = new Client({ + apiKey: "test-api-key", + autoBatchTracing: true, + }); const callSpy = jest .spyOn((client as any).caller, "call") .mockResolvedValue({ @@ -218,6 +227,7 @@ describe("Batch client tracing", () => { const client = new Client({ apiKey: "test-api-key", pendingAutoBatchedRunLimit: 10, + autoBatchTracing: true, }); const callSpy = jest .spyOn((client as any).caller, "call")