diff --git a/js/package.json b/js/package.json index 4c0a193ad..fc6c187da 100644 --- a/js/package.json +++ b/js/package.json @@ -1,6 +1,6 @@ { "name": "langsmith", - "version": "0.1.0", + "version": "0.1.1", "description": "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform.", "packageManager": "yarn@1.22.19", "files": [ diff --git a/js/src/index.ts b/js/src/index.ts index db32a5549..e49468e7e 100644 --- a/js/src/index.ts +++ b/js/src/index.ts @@ -11,4 +11,4 @@ export type { export { RunTree, type RunTreeConfig } from "./run_trees.js"; // Update using yarn bump-version -export const __version__ = "0.1.0"; +export const __version__ = "0.1.1"; diff --git a/js/src/tests/traceable.int.test.ts b/js/src/tests/traceable.int.test.ts index eaf3c05b8..de1277967 100644 --- a/js/src/tests/traceable.int.test.ts +++ b/js/src/tests/traceable.int.test.ts @@ -2,7 +2,7 @@ import { v4 as uuidv4 } from "uuid"; // eslint-disable-next-line import/no-extraneous-dependencies import { FakeStreamingLLM } from "@langchain/core/utils/testing"; import { Client } from "../client.js"; -import { traceable } from "../traceable.js"; +import { isTraceableFunction, traceable } from "../traceable.js"; import { RunTree } from "../run_trees.js"; async function deleteProject(langchainClient: Client, projectName: string) { @@ -76,6 +76,7 @@ test.concurrent( ); expect(await addValueTraceable("testing", 9)).toBe("testing9"); + expect(isTraceableFunction(addValueTraceable)).toBe(true); await waitUntilRunFound(langchainClient, runId, true); const storedRun = await langchainClient.readRun(runId); @@ -116,6 +117,7 @@ test.concurrent( ); expect(await entryTraceable({ value: "testing" })).toBe("testing123"); + expect(isTraceableFunction(entryTraceable)).toBe(true); await waitUntilRunFound(langchainClient, runId2, true); const storedRun2 = await langchainClient.readRun(runId2); @@ -131,6 +133,7 @@ test.concurrent( client: langchainClient, id: runId3, }); + expect(isTraceableFunction(iterableTraceable)).toBe(true); const chunks = []; @@ -163,6 +166,7 @@ test.concurrent( expect(await wrappedOverload("testing", 123)).toBe("testing123"); expect(await wrappedOverload({ a: "testing", b: 456 })).toBe("testing456"); + expect(isTraceableFunction(wrappedOverload)).toBe(true); }, 180_000 ); diff --git a/js/src/traceable.ts b/js/src/traceable.ts index e31fded3a..8cc35cfaa 100644 --- a/js/src/traceable.ts +++ b/js/src/traceable.ts @@ -179,7 +179,7 @@ export function traceable any>( }); }; - Object.defineProperty(wrappedFunc, "langsmith:traceable", { + Object.defineProperty(traceableFunc, "langsmith:traceable", { value: config, });