langsmith
Advanced tools
Comparing version 0.0.59 to 0.0.60
@@ -5,2 +5,3 @@ import * as uuid from "uuid"; | ||
import { getEnvironmentVariable, getRuntimeEnvironment } from "./utils/env.js"; | ||
import { __version__ } from "./index.js"; | ||
// utility functions | ||
@@ -138,3 +139,5 @@ const isLocalhost = (url) => { | ||
get headers() { | ||
const headers = {}; | ||
const headers = { | ||
"User-Agent": `langsmith-js/${__version__}`, | ||
}; | ||
if (this.apiKey) { | ||
@@ -141,0 +144,0 @@ headers["x-api-key"] = `${this.apiKey}`; |
export { Client } from "./client.js"; | ||
export { Dataset, Example, TracerSession, Run, Feedback } from "./schemas.js"; | ||
export { RunTree, RunTreeConfig } from "./run_trees.js"; | ||
export declare const __version__ = "0.0.60"; |
export { Client } from "./client.js"; | ||
export { RunTree } from "./run_trees.js"; | ||
// Update using yarn bump-version | ||
export const __version__ = "0.0.60"; |
@@ -17,2 +17,4 @@ declare global { | ||
libraryVersion?: string; | ||
sdk: string; | ||
sdk_version: string; | ||
runtime: string; | ||
@@ -19,0 +21,0 @@ runtimeVersion?: string; |
@@ -0,1 +1,4 @@ | ||
// Inlined from https://github.com/flexdinesh/browser-or-node | ||
import { __version__ } from "../index.js"; | ||
let globalEnv; | ||
export const isBrowser = () => typeof window !== "undefined" && typeof window.document !== "undefined"; | ||
@@ -18,22 +21,24 @@ export const isWebWorker = () => typeof globalThis === "object" && | ||
export const getEnv = () => { | ||
let env; | ||
if (globalEnv) { | ||
return globalEnv; | ||
} | ||
if (isBrowser()) { | ||
env = "browser"; | ||
globalEnv = "browser"; | ||
} | ||
else if (isNode()) { | ||
env = "node"; | ||
globalEnv = "node"; | ||
} | ||
else if (isWebWorker()) { | ||
env = "webworker"; | ||
globalEnv = "webworker"; | ||
} | ||
else if (isJsDom()) { | ||
env = "jsdom"; | ||
globalEnv = "jsdom"; | ||
} | ||
else if (isDeno()) { | ||
env = "deno"; | ||
globalEnv = "deno"; | ||
} | ||
else { | ||
env = "other"; | ||
globalEnv = "other"; | ||
} | ||
return env; | ||
return globalEnv; | ||
}; | ||
@@ -48,2 +53,4 @@ let runtimeEnvironment; | ||
runtime: env, | ||
sdk: "langsmith-js", | ||
sdk_version: __version__, | ||
...releaseEnv, | ||
@@ -50,0 +57,0 @@ }; |
{ | ||
"name": "langsmith", | ||
"version": "0.0.59", | ||
"version": "0.0.60", | ||
"description": "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform.", | ||
@@ -31,2 +31,4 @@ "files": [ | ||
"build": "yarn clean && yarn build:esm && yarn build:cjs && node scripts/create-entrypoints.js && node scripts/create-cli.js", | ||
"bump-version": "node scripts/bump-version.js", | ||
"check-version": "node scripts/check-version.js", | ||
"clean": "rm -rf dist/ && node scripts/create-entrypoints.js clean", | ||
@@ -33,0 +35,0 @@ "build:esm": "tsc --outDir dist/ && rm -rf dist/tests dist/**/tests", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
188477
4651
8