langsmith
Advanced tools
Comparing version 0.0.17 to 0.0.19
@@ -80,2 +80,7 @@ import { AsyncCallerParams } from "./utils/async_caller.js"; | ||
deleteRun(runId: string): Promise<void>; | ||
shareRun(runId: string, { shareId }?: { | ||
shareId?: string; | ||
}): Promise<string>; | ||
unshareRun(runId: string): Promise<void>; | ||
readRunSharedLink(runId: string): Promise<string | undefined>; | ||
createProject({ projectName, projectExtra, upsert, }: { | ||
@@ -82,0 +87,0 @@ projectName: string; |
@@ -281,2 +281,41 @@ import * as uuid from "uuid"; | ||
} | ||
async shareRun(runId, { shareId } = {}) { | ||
const data = { | ||
run_id: runId, | ||
share_token: shareId || uuid.v4(), | ||
}; | ||
const response = await this.caller.call(fetch, `${this.apiUrl}/runs/${runId}/share`, { | ||
method: "PUT", | ||
headers: this.headers, | ||
body: JSON.stringify(data), | ||
signal: AbortSignal.timeout(this.timeout_ms), | ||
}); | ||
// await raiseForStatus(response, "share run"); | ||
const result = await response.json(); | ||
if (result === null || !("share_token" in result)) { | ||
throw new Error("Invalid response from server"); | ||
} | ||
return `${this.getHostUrl()}/public/${result["share_token"]}/r`; | ||
} | ||
async unshareRun(runId) { | ||
const response = await this.caller.call(fetch, `${this.apiUrl}/runs/${runId}/share`, { | ||
method: "DELETE", | ||
headers: this.headers, | ||
signal: AbortSignal.timeout(this.timeout_ms), | ||
}); | ||
await raiseForStatus(response, "unshare run"); | ||
} | ||
async readRunSharedLink(runId) { | ||
const response = await this.caller.call(fetch, `${this.apiUrl}/runs/${runId}/share`, { | ||
method: "GET", | ||
headers: this.headers, | ||
signal: AbortSignal.timeout(this.timeout_ms), | ||
}); | ||
// await raiseForStatus(response, "read run shared link"); | ||
const result = await response.json(); | ||
if (result === null || !("share_token" in result)) { | ||
return undefined; | ||
} | ||
return `${this.getHostUrl()}/public/${result["share_token"]}/r`; | ||
} | ||
async createProject({ projectName, projectExtra, upsert, }) { | ||
@@ -283,0 +322,0 @@ const upsert_ = upsert ? `?upsert=true` : ""; |
{ | ||
"name": "langsmith", | ||
"version": "0.0.17", | ||
"version": "0.0.19", | ||
"description": "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform.", | ||
@@ -45,3 +45,3 @@ "files": [ | ||
"type": "git", | ||
"url": "git+https://github.com/langchain-ai/langchainplus-sdk.git" | ||
"url": "git+https://github.com/langchain-ai/langsmith-sdk.git" | ||
}, | ||
@@ -57,5 +57,5 @@ "keywords": [ | ||
"bugs": { | ||
"url": "https://github.com/langchain-ai/langchainplus-sdk/issues" | ||
"url": "https://github.com/langchain-ai/langsmith-sdk/issues" | ||
}, | ||
"homepage": "https://github.com/langchain-ai/langchainplus-sdk#readme", | ||
"homepage": "https://github.com/langchain-ai/langsmith-sdk#readme", | ||
"devDependencies": { | ||
@@ -62,0 +62,0 @@ "@babel/preset-env": "^7.22.4", |
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
148806
3696
44