langsmith 0.5.16 → 0.5.17
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 +112 -143
- package/dist/client.d.ts +19 -40
- package/dist/client.js +112 -143
- package/dist/experimental/anthropic/index.cjs +4 -1
- package/dist/experimental/anthropic/index.js +4 -1
- package/dist/experimental/vercel/index.cjs +1 -0
- package/dist/experimental/vercel/index.js +1 -0
- package/dist/experimental/vercel/middleware.cjs +2 -0
- package/dist/experimental/vercel/middleware.js +2 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/schemas.d.ts +1 -3
- package/dist/utils/chalk/source/index.cjs +187 -0
- package/dist/utils/chalk/source/index.d.ts +19 -0
- package/dist/utils/chalk/source/index.js +173 -0
- package/dist/utils/chalk/source/utilities.cjs +35 -0
- package/dist/utils/chalk/source/utilities.d.ts +2 -0
- package/dist/utils/chalk/source/utilities.js +31 -0
- package/dist/utils/chalk/source/vendor/ansi-styles/index.cjs +193 -0
- package/dist/utils/chalk/source/vendor/ansi-styles/index.d.ts +58 -0
- package/dist/utils/chalk/source/vendor/ansi-styles/index.js +190 -0
- package/dist/utils/chalk/source/vendor/supports-color/browser.cjs +31 -0
- package/dist/utils/chalk/source/vendor/supports-color/browser.d.ts +15 -0
- package/dist/utils/chalk/source/vendor/supports-color/browser.js +29 -0
- package/dist/utils/chalk/source/vendor/supports-color/index.cjs +155 -0
- package/dist/utils/chalk/source/vendor/supports-color/index.d.ts +21 -0
- package/dist/utils/chalk/source/vendor/supports-color/index.js +149 -0
- package/dist/utils/console-table-printer/index.cjs +11 -0
- package/dist/utils/console-table-printer/index.d.ts +4 -0
- package/dist/utils/console-table-printer/index.js +3 -0
- package/dist/utils/console-table-printer/src/console-table-printer.cjs +42 -0
- package/dist/utils/console-table-printer/src/console-table-printer.d.ts +14 -0
- package/dist/utils/console-table-printer/src/console-table-printer.js +36 -0
- package/dist/utils/console-table-printer/src/internalTable/input-converter.cjs +25 -0
- package/dist/utils/console-table-printer/src/internalTable/input-converter.d.ts +6 -0
- package/dist/utils/console-table-printer/src/internalTable/input-converter.js +20 -0
- package/dist/utils/console-table-printer/src/internalTable/internal-table-printer.cjs +142 -0
- package/dist/utils/console-table-printer/src/internalTable/internal-table-printer.d.ts +6 -0
- package/dist/utils/console-table-printer/src/internalTable/internal-table-printer.js +133 -0
- package/dist/utils/console-table-printer/src/internalTable/internal-table.cjs +186 -0
- package/dist/utils/console-table-printer/src/internalTable/internal-table.d.ts +31 -0
- package/dist/utils/console-table-printer/src/internalTable/internal-table.js +184 -0
- package/dist/utils/console-table-printer/src/internalTable/table-pre-processors.cjs +53 -0
- package/dist/utils/console-table-printer/src/internalTable/table-pre-processors.d.ts +3 -0
- package/dist/utils/console-table-printer/src/internalTable/table-pre-processors.js +48 -0
- package/dist/utils/console-table-printer/src/models/common.cjs +2 -0
- package/dist/utils/console-table-printer/src/models/common.d.ts +14 -0
- package/dist/utils/console-table-printer/src/models/common.js +1 -0
- package/dist/utils/console-table-printer/src/models/external-table.cjs +2 -0
- package/dist/utils/console-table-printer/src/models/external-table.d.ts +99 -0
- package/dist/utils/console-table-printer/src/models/external-table.js +1 -0
- package/dist/utils/console-table-printer/src/models/internal-table.cjs +2 -0
- package/dist/utils/console-table-printer/src/models/internal-table.d.ts +24 -0
- package/dist/utils/console-table-printer/src/models/internal-table.js +1 -0
- package/dist/utils/console-table-printer/src/utils/colored-console-line.cjs +43 -0
- package/dist/utils/console-table-printer/src/utils/colored-console-line.d.ts +12 -0
- package/dist/utils/console-table-printer/src/utils/colored-console-line.js +39 -0
- package/dist/utils/console-table-printer/src/utils/console-utils.cjs +23 -0
- package/dist/utils/console-table-printer/src/utils/console-utils.d.ts +3 -0
- package/dist/utils/console-table-printer/src/utils/console-utils.js +18 -0
- package/dist/utils/console-table-printer/src/utils/string-utils.cjs +68 -0
- package/dist/utils/console-table-printer/src/utils/string-utils.d.ts +4 -0
- package/dist/utils/console-table-printer/src/utils/string-utils.js +62 -0
- package/dist/utils/console-table-printer/src/utils/table-constants.cjs +55 -0
- package/dist/utils/console-table-printer/src/utils/table-constants.d.ts +11 -0
- package/dist/utils/console-table-printer/src/utils/table-constants.js +52 -0
- package/dist/utils/console-table-printer/src/utils/table-helpers.cjs +101 -0
- package/dist/utils/console-table-printer/src/utils/table-helpers.d.ts +29 -0
- package/dist/utils/console-table-printer/src/utils/table-helpers.js +88 -0
- package/dist/utils/jestlike/reporter.cjs +23 -23
- package/dist/utils/jestlike/reporter.js +2 -2
- package/dist/utils/prompts.cjs +0 -10
- package/dist/utils/prompts.d.ts +0 -1
- package/dist/utils/prompts.js +0 -9
- package/dist/utils/simple-wcswidth/index.cjs +10 -0
- package/dist/utils/simple-wcswidth/index.d.ts +3 -0
- package/dist/utils/simple-wcswidth/index.js +3 -0
- package/dist/utils/simple-wcswidth/src/binary-search.cjs +24 -0
- package/dist/utils/simple-wcswidth/src/binary-search.d.ts +3 -0
- package/dist/utils/simple-wcswidth/src/binary-search.js +22 -0
- package/dist/utils/simple-wcswidth/src/models.cjs +2 -0
- package/dist/utils/simple-wcswidth/src/models.d.ts +4 -0
- package/dist/utils/simple-wcswidth/src/models.js +1 -0
- package/dist/utils/simple-wcswidth/src/non-spacing-chars.cjs +149 -0
- package/dist/utils/simple-wcswidth/src/non-spacing-chars.d.ts +3 -0
- package/dist/utils/simple-wcswidth/src/non-spacing-chars.js +147 -0
- package/dist/utils/simple-wcswidth/src/wcswidth.cjs +20 -0
- package/dist/utils/simple-wcswidth/src/wcswidth.d.ts +2 -0
- package/dist/utils/simple-wcswidth/src/wcswidth.js +15 -0
- package/dist/utils/simple-wcswidth/src/wcwidth.cjs +67 -0
- package/dist/utils/simple-wcswidth/src/wcwidth.d.ts +2 -0
- package/dist/utils/simple-wcswidth/src/wcwidth.js +62 -0
- package/package.json +5 -7
package/dist/client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { OTELContext } from "./experimental/otel/types.js";
|
|
2
2
|
import { AsyncCallerParams } from "./utils/async_caller.js";
|
|
3
|
-
import { ComparativeExperiment, DataType, Dataset, DatasetDiffInfo, DatasetShareSchema, Example, ExampleCreate, ExampleUpdate, ExampleUpdateWithoutId, Feedback, FeedbackConfig, FeedbackIngestToken, KVMap, LangChainBaseMessage, LangSmithSettings, LikePromptResponse, Prompt, PromptCommit, PromptSortField, Run, RunCreate, RunUpdate, ScoreType,
|
|
3
|
+
import { ComparativeExperiment, DataType, Dataset, DatasetDiffInfo, DatasetShareSchema, Example, ExampleCreate, ExampleUpdate, ExampleUpdateWithoutId, Feedback, FeedbackConfig, FeedbackIngestToken, KVMap, LangChainBaseMessage, LangSmithSettings, LikePromptResponse, Prompt, PromptCommit, PromptSortField, Run, RunCreate, RunUpdate, ScoreType, TimeDelta, TracerSession, TracerSessionResult, ValueType, AnnotationQueue, RunWithAnnotationQueueInfo, Attachments, UploadExamplesResponse, UpdateExamplesResponse, DatasetVersion, AnnotationQueueWithDetails, AnnotationQueueRubricItem, FeedbackConfigSchema } from "./schemas.js";
|
|
4
4
|
import { EvaluationResult, EvaluationResults } from "./evaluation/evaluator.js";
|
|
5
5
|
import { PromptCache } from "./utils/prompt_cache/index.js";
|
|
6
6
|
export interface ClientConfig {
|
|
@@ -55,6 +55,13 @@ export interface ClientConfig {
|
|
|
55
55
|
* By default, prompt caching is enabled globally.
|
|
56
56
|
*/
|
|
57
57
|
disablePromptCache?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Additional HTTP headers to include in all requests.
|
|
60
|
+
* These headers will be merged with the default headers (User-Agent,
|
|
61
|
+
* x-api-key, x-tenant-id, etc.). Custom headers will not override
|
|
62
|
+
* the default required headers.
|
|
63
|
+
*/
|
|
64
|
+
headers?: Record<string, string>;
|
|
58
65
|
/**
|
|
59
66
|
* @deprecated Use `configureGlobalPromptCache()` to configure caching, or
|
|
60
67
|
* `disablePromptCache: true` to disable it. This parameter is deprecated.
|
|
@@ -416,6 +423,7 @@ export declare class Client implements LangSmithTracingClientInterface {
|
|
|
416
423
|
private failedTracesDir;
|
|
417
424
|
private failedTracesMaxBytes;
|
|
418
425
|
private static _fallbackDirsCreated;
|
|
426
|
+
private _customHeaders;
|
|
419
427
|
debug: boolean;
|
|
420
428
|
constructor(config?: ClientConfig);
|
|
421
429
|
static getDefaultClientConfig(): {
|
|
@@ -426,7 +434,14 @@ export declare class Client implements LangSmithTracingClientInterface {
|
|
|
426
434
|
hideOutputs?: boolean;
|
|
427
435
|
};
|
|
428
436
|
getHostUrl(): string;
|
|
429
|
-
private get
|
|
437
|
+
private get _mergedHeaders();
|
|
438
|
+
/**
|
|
439
|
+
* Get or set custom headers for the client.
|
|
440
|
+
* Custom headers are merged with default headers (User-Agent, x-api-key, x-tenant-id).
|
|
441
|
+
* Custom headers will not override the default required headers.
|
|
442
|
+
*/
|
|
443
|
+
get headers(): Record<string, string>;
|
|
444
|
+
set headers(value: Record<string, string> | undefined);
|
|
430
445
|
private _getPlatformEndpointPath;
|
|
431
446
|
private processInputs;
|
|
432
447
|
private processOutputs;
|
|
@@ -754,44 +769,6 @@ export declare class Client implements LangSmithTracingClientInterface {
|
|
|
754
769
|
datasetId?: string;
|
|
755
770
|
datasetName?: string;
|
|
756
771
|
}): Promise<void>;
|
|
757
|
-
indexDataset({ datasetId, datasetName, tag, }: {
|
|
758
|
-
datasetId?: string;
|
|
759
|
-
datasetName?: string;
|
|
760
|
-
tag?: string;
|
|
761
|
-
}): Promise<void>;
|
|
762
|
-
/**
|
|
763
|
-
* Lets you run a similarity search query on a dataset.
|
|
764
|
-
*
|
|
765
|
-
* Requires the dataset to be indexed. Please see the `indexDataset` method to set up indexing.
|
|
766
|
-
*
|
|
767
|
-
* @param inputs The input on which to run the similarity search. Must have the
|
|
768
|
-
* same schema as the dataset.
|
|
769
|
-
*
|
|
770
|
-
* @param datasetId The dataset to search for similar examples.
|
|
771
|
-
*
|
|
772
|
-
* @param limit The maximum number of examples to return. Will return the top `limit` most
|
|
773
|
-
* similar examples in order of most similar to least similar. If no similar
|
|
774
|
-
* examples are found, random examples will be returned.
|
|
775
|
-
*
|
|
776
|
-
* @param filter A filter string to apply to the search. Only examples will be returned that
|
|
777
|
-
* match the filter string. Some examples of filters
|
|
778
|
-
*
|
|
779
|
-
* - eq(metadata.mykey, "value")
|
|
780
|
-
* - and(neq(metadata.my.nested.key, "value"), neq(metadata.mykey, "value"))
|
|
781
|
-
* - or(eq(metadata.mykey, "value"), eq(metadata.mykey, "othervalue"))
|
|
782
|
-
*
|
|
783
|
-
* @returns A list of similar examples.
|
|
784
|
-
*
|
|
785
|
-
*
|
|
786
|
-
* @example
|
|
787
|
-
* dataset_id = "123e4567-e89b-12d3-a456-426614174000"
|
|
788
|
-
* inputs = {"text": "How many people live in Berlin?"}
|
|
789
|
-
* limit = 5
|
|
790
|
-
* examples = await client.similarExamples(inputs, dataset_id, limit)
|
|
791
|
-
*/
|
|
792
|
-
similarExamples(inputs: KVMap, datasetId: string, limit: number, { filter, }?: {
|
|
793
|
-
filter?: string;
|
|
794
|
-
}): Promise<ExampleSearch[]>;
|
|
795
772
|
createExample(update: ExampleCreate): Promise<Example>;
|
|
796
773
|
/**
|
|
797
774
|
* @deprecated This signature is deprecated, use createExample(update: ExampleCreate) instead
|
|
@@ -1264,6 +1241,7 @@ export declare class Client implements LangSmithTracingClientInterface {
|
|
|
1264
1241
|
*/
|
|
1265
1242
|
createCommit(promptIdentifier: string, object: any, options?: {
|
|
1266
1243
|
parentCommitHash?: string;
|
|
1244
|
+
description?: string;
|
|
1267
1245
|
}): Promise<string>;
|
|
1268
1246
|
/**
|
|
1269
1247
|
* Update examples with attachments using multipart form data.
|
|
@@ -1317,6 +1295,7 @@ export declare class Client implements LangSmithTracingClientInterface {
|
|
|
1317
1295
|
description?: string;
|
|
1318
1296
|
readme?: string;
|
|
1319
1297
|
tags?: string[];
|
|
1298
|
+
commitDescription?: string;
|
|
1320
1299
|
}): Promise<string>;
|
|
1321
1300
|
/**
|
|
1322
1301
|
* Clone a public dataset to your own langsmith tenant.
|