langsmith
Advanced tools
Comparing version 0.0.31 to 0.0.32
@@ -64,2 +64,3 @@ export interface TracerSession { | ||
error?: string; | ||
inputs?: KVMap; | ||
outputs?: KVMap; | ||
@@ -66,0 +67,0 @@ parent_run_id?: string; |
@@ -23,1 +23,11 @@ declare global { | ||
export declare function setEnvironmentVariable(name: string, value: string): void; | ||
interface ICommitSHAs { | ||
[key: string]: string; | ||
} | ||
/** | ||
* Get the Git commit SHA from common environment variables | ||
* used by different CI/CD platforms. | ||
* @returns {string | undefined} The Git commit SHA or undefined if not found. | ||
*/ | ||
export declare function getShas(): ICommitSHAs; | ||
export {}; |
@@ -43,5 +43,7 @@ export const isBrowser = () => typeof window !== "undefined" && typeof window.document !== "undefined"; | ||
const env = getEnv(); | ||
const releaseEnv = getShas(); | ||
runtimeEnvironment = { | ||
library: "langsmith", | ||
runtime: env, | ||
...releaseEnv, | ||
}; | ||
@@ -70,1 +72,42 @@ } | ||
} | ||
let cachedCommitSHAs; | ||
/** | ||
* Get the Git commit SHA from common environment variables | ||
* used by different CI/CD platforms. | ||
* @returns {string | undefined} The Git commit SHA or undefined if not found. | ||
*/ | ||
export function getShas() { | ||
if (cachedCommitSHAs !== undefined) { | ||
return cachedCommitSHAs; | ||
} | ||
const common_release_envs = [ | ||
"VERCEL_GIT_COMMIT_SHA", | ||
"NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA", | ||
"COMMIT_REF", | ||
"RENDER_GIT_COMMIT", | ||
"CI_COMMIT_SHA", | ||
"CIRCLE_SHA1", | ||
"CF_PAGES_COMMIT_SHA", | ||
"REACT_APP_GIT_SHA", | ||
"SOURCE_VERSION", | ||
"GITHUB_SHA", | ||
"TRAVIS_COMMIT", | ||
"GIT_COMMIT", | ||
"BUILD_VCS_NUMBER", | ||
"bamboo_planRepository_revision", | ||
"Build.SourceVersion", | ||
"BITBUCKET_COMMIT", | ||
"DRONE_COMMIT_SHA", | ||
"SEMAPHORE_GIT_SHA", | ||
"BUILDKITE_COMMIT", | ||
]; | ||
const shas = {}; | ||
for (const env of common_release_envs) { | ||
const envVar = getEnvironmentVariable(env); | ||
if (envVar !== undefined) { | ||
shas[env] = envVar; | ||
} | ||
} | ||
cachedCommitSHAs = shas; | ||
return shas; | ||
} |
{ | ||
"name": "langsmith", | ||
"version": "0.0.31", | ||
"version": "0.0.32", | ||
"description": "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform.", | ||
@@ -5,0 +5,0 @@ "files": [ |
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
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
162238
4022