langsmith 0.3.21 → 0.3.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.cjs +18 -12
- package/dist/client.d.ts +6 -4
- package/dist/client.js +18 -12
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/schemas.d.ts +4 -0
- package/dist/vercel.cjs +6 -1
- package/dist/vercel.js +6 -1
- package/package.json +5 -5
package/dist/client.cjs
CHANGED
|
@@ -2644,11 +2644,12 @@ class Client {
|
|
|
2644
2644
|
* @returns The created AnnotationQueue object
|
|
2645
2645
|
*/
|
|
2646
2646
|
async createAnnotationQueue(options) {
|
|
2647
|
-
const { name, description, queueId } = options;
|
|
2647
|
+
const { name, description, queueId, rubricInstructions } = options;
|
|
2648
2648
|
const body = {
|
|
2649
2649
|
name,
|
|
2650
2650
|
description,
|
|
2651
2651
|
id: queueId || uuid.v4(),
|
|
2652
|
+
rubric_instructions: rubricInstructions,
|
|
2652
2653
|
};
|
|
2653
2654
|
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(this.debug), `${this.apiUrl}/annotation-queues`, {
|
|
2654
2655
|
method: "POST",
|
|
@@ -2664,17 +2665,18 @@ class Client {
|
|
|
2664
2665
|
/**
|
|
2665
2666
|
* Read an annotation queue with the specified queue ID.
|
|
2666
2667
|
* @param queueId - The ID of the annotation queue to read
|
|
2667
|
-
* @returns The
|
|
2668
|
+
* @returns The AnnotationQueueWithDetails object
|
|
2668
2669
|
*/
|
|
2669
2670
|
async readAnnotationQueue(queueId) {
|
|
2670
|
-
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
|
|
2676
|
-
|
|
2677
|
-
|
|
2671
|
+
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(this.debug), `${this.apiUrl}/annotation-queues/${(0, _uuid_js_1.assertUuid)(queueId, "queueId")}`, {
|
|
2672
|
+
method: "GET",
|
|
2673
|
+
headers: this.headers,
|
|
2674
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2675
|
+
...this.fetchOptions,
|
|
2676
|
+
});
|
|
2677
|
+
await (0, error_js_1.raiseForStatus)(response, "read annotation queue");
|
|
2678
|
+
const data = await response.json();
|
|
2679
|
+
return data;
|
|
2678
2680
|
}
|
|
2679
2681
|
/**
|
|
2680
2682
|
* Update an annotation queue with the specified queue ID.
|
|
@@ -2684,11 +2686,15 @@ class Client {
|
|
|
2684
2686
|
* @param options.description - The new description for the annotation queue
|
|
2685
2687
|
*/
|
|
2686
2688
|
async updateAnnotationQueue(queueId, options) {
|
|
2687
|
-
const { name, description } = options;
|
|
2689
|
+
const { name, description, rubricInstructions } = options;
|
|
2688
2690
|
const response = await this.caller.call((0, fetch_js_1._getFetchImplementation)(this.debug), `${this.apiUrl}/annotation-queues/${(0, _uuid_js_1.assertUuid)(queueId, "queueId")}`, {
|
|
2689
2691
|
method: "PATCH",
|
|
2690
2692
|
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
2691
|
-
body: JSON.stringify({
|
|
2693
|
+
body: JSON.stringify({
|
|
2694
|
+
name,
|
|
2695
|
+
description,
|
|
2696
|
+
rubric_instructions: rubricInstructions,
|
|
2697
|
+
}),
|
|
2692
2698
|
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2693
2699
|
...this.fetchOptions,
|
|
2694
2700
|
});
|
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AsyncCallerParams } from "./utils/async_caller.js";
|
|
2
|
-
import { ComparativeExperiment, DataType, Dataset, DatasetDiffInfo, DatasetShareSchema, Example, ExampleCreate, ExampleUpdate, ExampleUpdateWithoutId, Feedback, FeedbackConfig, FeedbackIngestToken, KVMap, LangChainBaseMessage, LangSmithSettings, LikePromptResponse, Prompt, PromptCommit, PromptSortField, Run, RunCreate, RunUpdate, ScoreType, ExampleSearch, TimeDelta, TracerSession, TracerSessionResult, ValueType, AnnotationQueue, RunWithAnnotationQueueInfo, Attachments, UploadExamplesResponse, UpdateExamplesResponse, DatasetVersion } from "./schemas.js";
|
|
2
|
+
import { ComparativeExperiment, DataType, Dataset, DatasetDiffInfo, DatasetShareSchema, Example, ExampleCreate, ExampleUpdate, ExampleUpdateWithoutId, Feedback, FeedbackConfig, FeedbackIngestToken, KVMap, LangChainBaseMessage, LangSmithSettings, LikePromptResponse, Prompt, PromptCommit, PromptSortField, Run, RunCreate, RunUpdate, ScoreType, ExampleSearch, TimeDelta, TracerSession, TracerSessionResult, ValueType, AnnotationQueue, RunWithAnnotationQueueInfo, Attachments, UploadExamplesResponse, UpdateExamplesResponse, DatasetVersion, AnnotationQueueWithDetails } from "./schemas.js";
|
|
3
3
|
import { EvaluationResult, EvaluationResults, RunEvaluator } from "./evaluation/evaluator.js";
|
|
4
4
|
export interface ClientConfig {
|
|
5
5
|
apiUrl?: string;
|
|
@@ -743,13 +743,14 @@ export declare class Client implements LangSmithTracingClientInterface {
|
|
|
743
743
|
name: string;
|
|
744
744
|
description?: string;
|
|
745
745
|
queueId?: string;
|
|
746
|
-
|
|
746
|
+
rubricInstructions?: string;
|
|
747
|
+
}): Promise<AnnotationQueueWithDetails>;
|
|
747
748
|
/**
|
|
748
749
|
* Read an annotation queue with the specified queue ID.
|
|
749
750
|
* @param queueId - The ID of the annotation queue to read
|
|
750
|
-
* @returns The
|
|
751
|
+
* @returns The AnnotationQueueWithDetails object
|
|
751
752
|
*/
|
|
752
|
-
readAnnotationQueue(queueId: string): Promise<
|
|
753
|
+
readAnnotationQueue(queueId: string): Promise<AnnotationQueueWithDetails>;
|
|
753
754
|
/**
|
|
754
755
|
* Update an annotation queue with the specified queue ID.
|
|
755
756
|
* @param queueId - The ID of the annotation queue to update
|
|
@@ -760,6 +761,7 @@ export declare class Client implements LangSmithTracingClientInterface {
|
|
|
760
761
|
updateAnnotationQueue(queueId: string, options: {
|
|
761
762
|
name: string;
|
|
762
763
|
description?: string;
|
|
764
|
+
rubricInstructions?: string;
|
|
763
765
|
}): Promise<void>;
|
|
764
766
|
/**
|
|
765
767
|
* Delete an annotation queue with the specified queue ID.
|
package/dist/client.js
CHANGED
|
@@ -2606,11 +2606,12 @@ export class Client {
|
|
|
2606
2606
|
* @returns The created AnnotationQueue object
|
|
2607
2607
|
*/
|
|
2608
2608
|
async createAnnotationQueue(options) {
|
|
2609
|
-
const { name, description, queueId } = options;
|
|
2609
|
+
const { name, description, queueId, rubricInstructions } = options;
|
|
2610
2610
|
const body = {
|
|
2611
2611
|
name,
|
|
2612
2612
|
description,
|
|
2613
2613
|
id: queueId || uuid.v4(),
|
|
2614
|
+
rubric_instructions: rubricInstructions,
|
|
2614
2615
|
};
|
|
2615
2616
|
const response = await this.caller.call(_getFetchImplementation(this.debug), `${this.apiUrl}/annotation-queues`, {
|
|
2616
2617
|
method: "POST",
|
|
@@ -2626,17 +2627,18 @@ export class Client {
|
|
|
2626
2627
|
/**
|
|
2627
2628
|
* Read an annotation queue with the specified queue ID.
|
|
2628
2629
|
* @param queueId - The ID of the annotation queue to read
|
|
2629
|
-
* @returns The
|
|
2630
|
+
* @returns The AnnotationQueueWithDetails object
|
|
2630
2631
|
*/
|
|
2631
2632
|
async readAnnotationQueue(queueId) {
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2633
|
+
const response = await this.caller.call(_getFetchImplementation(this.debug), `${this.apiUrl}/annotation-queues/${assertUuid(queueId, "queueId")}`, {
|
|
2634
|
+
method: "GET",
|
|
2635
|
+
headers: this.headers,
|
|
2636
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2637
|
+
...this.fetchOptions,
|
|
2638
|
+
});
|
|
2639
|
+
await raiseForStatus(response, "read annotation queue");
|
|
2640
|
+
const data = await response.json();
|
|
2641
|
+
return data;
|
|
2640
2642
|
}
|
|
2641
2643
|
/**
|
|
2642
2644
|
* Update an annotation queue with the specified queue ID.
|
|
@@ -2646,11 +2648,15 @@ export class Client {
|
|
|
2646
2648
|
* @param options.description - The new description for the annotation queue
|
|
2647
2649
|
*/
|
|
2648
2650
|
async updateAnnotationQueue(queueId, options) {
|
|
2649
|
-
const { name, description } = options;
|
|
2651
|
+
const { name, description, rubricInstructions } = options;
|
|
2650
2652
|
const response = await this.caller.call(_getFetchImplementation(this.debug), `${this.apiUrl}/annotation-queues/${assertUuid(queueId, "queueId")}`, {
|
|
2651
2653
|
method: "PATCH",
|
|
2652
2654
|
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
2653
|
-
body: JSON.stringify({
|
|
2655
|
+
body: JSON.stringify({
|
|
2656
|
+
name,
|
|
2657
|
+
description,
|
|
2658
|
+
rubric_instructions: rubricInstructions,
|
|
2659
|
+
}),
|
|
2654
2660
|
signal: AbortSignal.timeout(this.timeout_ms),
|
|
2655
2661
|
...this.fetchOptions,
|
|
2656
2662
|
});
|
package/dist/index.cjs
CHANGED
|
@@ -8,4 +8,4 @@ Object.defineProperty(exports, "RunTree", { enumerable: true, get: function () {
|
|
|
8
8
|
var fetch_js_1 = require("./singletons/fetch.cjs");
|
|
9
9
|
Object.defineProperty(exports, "overrideFetchImplementation", { enumerable: true, get: function () { return fetch_js_1.overrideFetchImplementation; } });
|
|
10
10
|
// Update using yarn bump-version
|
|
11
|
-
exports.__version__ = "0.3.
|
|
11
|
+
exports.__version__ = "0.3.23";
|
package/dist/index.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ export { Client, type ClientConfig, type LangSmithTracingClientInterface, } from
|
|
|
2
2
|
export type { Dataset, Example, TracerSession, Run, Feedback, RetrieverOutput, } from "./schemas.js";
|
|
3
3
|
export { RunTree, type RunTreeConfig } from "./run_trees.js";
|
|
4
4
|
export { overrideFetchImplementation } from "./singletons/fetch.js";
|
|
5
|
-
export declare const __version__ = "0.3.
|
|
5
|
+
export declare const __version__ = "0.3.23";
|
package/dist/index.js
CHANGED
package/dist/schemas.d.ts
CHANGED
|
@@ -451,6 +451,10 @@ export interface AnnotationQueue {
|
|
|
451
451
|
/** The ID of the tenant associated with the annotation queue. */
|
|
452
452
|
tenant_id: string;
|
|
453
453
|
}
|
|
454
|
+
export interface AnnotationQueueWithDetails extends AnnotationQueue {
|
|
455
|
+
/** The rubric instructions for the annotation queue. */
|
|
456
|
+
rubric_instructions?: string;
|
|
457
|
+
}
|
|
454
458
|
export interface RunWithAnnotationQueueInfo extends BaseRun {
|
|
455
459
|
/** The last time this run was reviewed. */
|
|
456
460
|
last_reviewed_time?: string;
|
package/dist/vercel.cjs
CHANGED
|
@@ -580,7 +580,12 @@ class AISDKExporter {
|
|
|
580
580
|
.sort((a, b) => sortByHr(a.startTime, b.startTime));
|
|
581
581
|
for (const span of typedSpans) {
|
|
582
582
|
const { traceId, spanId } = span.spanContext();
|
|
583
|
-
const parentId =
|
|
583
|
+
const parentId =
|
|
584
|
+
// Backcompat shim to support OTEL 1.x and 2.x
|
|
585
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
586
|
+
span.parentSpanId ??
|
|
587
|
+
span.parentSpanContext?.spanId ??
|
|
588
|
+
undefined;
|
|
584
589
|
this.traceByMap[traceId] ??= {
|
|
585
590
|
childMap: {},
|
|
586
591
|
nodeMap: {},
|
package/dist/vercel.js
CHANGED
|
@@ -577,7 +577,12 @@ export class AISDKExporter {
|
|
|
577
577
|
.sort((a, b) => sortByHr(a.startTime, b.startTime));
|
|
578
578
|
for (const span of typedSpans) {
|
|
579
579
|
const { traceId, spanId } = span.spanContext();
|
|
580
|
-
const parentId =
|
|
580
|
+
const parentId =
|
|
581
|
+
// Backcompat shim to support OTEL 1.x and 2.x
|
|
582
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
583
|
+
span.parentSpanId ??
|
|
584
|
+
span.parentSpanContext?.spanId ??
|
|
585
|
+
undefined;
|
|
581
586
|
this.traceByMap[traceId] ??= {
|
|
582
587
|
childMap: {},
|
|
583
588
|
nodeMap: {},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "langsmith",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.23",
|
|
4
4
|
"description": "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform.",
|
|
5
5
|
"packageManager": "yarn@1.22.19",
|
|
6
6
|
"files": [
|
|
@@ -132,7 +132,7 @@
|
|
|
132
132
|
"uuid": "^10.0.0"
|
|
133
133
|
},
|
|
134
134
|
"devDependencies": {
|
|
135
|
-
"@ai-sdk/openai": "^1.
|
|
135
|
+
"@ai-sdk/openai": "^1.3.20",
|
|
136
136
|
"@babel/preset-env": "^7.22.4",
|
|
137
137
|
"@faker-js/faker": "^8.4.1",
|
|
138
138
|
"@jest/globals": "^29.5.0",
|
|
@@ -141,13 +141,13 @@
|
|
|
141
141
|
"@langchain/langgraph": "^0.2.20",
|
|
142
142
|
"@langchain/openai": "^0.3.11",
|
|
143
143
|
"@opentelemetry/api": "^1.9.0",
|
|
144
|
-
"@opentelemetry/sdk-trace-base": "^
|
|
145
|
-
"@opentelemetry/sdk-trace-node": "^
|
|
144
|
+
"@opentelemetry/sdk-trace-base": "^2.0.0",
|
|
145
|
+
"@opentelemetry/sdk-trace-node": "^2.0.0",
|
|
146
146
|
"@tsconfig/recommended": "^1.0.2",
|
|
147
147
|
"@types/jest": "^29.5.1",
|
|
148
148
|
"@typescript-eslint/eslint-plugin": "^5.59.8",
|
|
149
149
|
"@typescript-eslint/parser": "^5.59.8",
|
|
150
|
-
"ai": "^4.
|
|
150
|
+
"ai": "^4.3.10",
|
|
151
151
|
"babel-jest": "^29.5.0",
|
|
152
152
|
"cross-env": "^7.0.3",
|
|
153
153
|
"dotenv": "^16.1.3",
|