Skip to content

Commit

Permalink
JS autobatch off (#410)
Browse files Browse the repository at this point in the history
  • Loading branch information
hinthornw authored Feb 7, 2024
1 parent b8973ee commit d8a68da
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion js/package.json
Original file line number Diff line number Diff line change
@@ -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": "[email protected]",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion js/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export class Client {

private sampledPostUuids = new Set();

private autoBatchTracing = true;
private autoBatchTracing = false;

private pendingAutoBatchedRuns: AutoBatchQueueItem[] = [];

Expand Down
2 changes: 1 addition & 1 deletion js/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
16 changes: 13 additions & 3 deletions js/src/tests/batch_client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -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({
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit d8a68da

Please sign in to comment.