opik 2.0.19 → 2.0.21
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/chunk-XQEUQ5J4.js +404 -0
- package/dist/index.cjs +36 -36
- package/dist/index.d.cts +183 -8
- package/dist/index.d.ts +183 -8
- package/dist/index.js +1 -1
- package/dist/{suite-ZKMDSCVB.js → suite-N4PQBN76.js} +1 -1
- package/package.json +1 -1
- package/dist/chunk-H3272XZV.js +0 -404
package/dist/index.d.cts
CHANGED
|
@@ -697,6 +697,8 @@ interface ChatCompletionRequest {
|
|
|
697
697
|
metadata?: Record<string, string>;
|
|
698
698
|
reasoningEffort?: string;
|
|
699
699
|
serviceTier?: string;
|
|
700
|
+
logprobs?: boolean;
|
|
701
|
+
topLogprobs?: number;
|
|
700
702
|
functions?: Function$1[];
|
|
701
703
|
functionCall?: FunctionCall;
|
|
702
704
|
}
|
|
@@ -1138,6 +1140,37 @@ declare const DatasetWriteVisibility: {
|
|
|
1138
1140
|
};
|
|
1139
1141
|
type DatasetWriteVisibility = (typeof DatasetWriteVisibility)[keyof typeof DatasetWriteVisibility];
|
|
1140
1142
|
|
|
1143
|
+
/**
|
|
1144
|
+
* @example
|
|
1145
|
+
* {}
|
|
1146
|
+
*/
|
|
1147
|
+
interface EnvironmentUpdate {
|
|
1148
|
+
name?: string;
|
|
1149
|
+
description?: string;
|
|
1150
|
+
color?: string;
|
|
1151
|
+
position?: number;
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
/**
|
|
1155
|
+
* @example
|
|
1156
|
+
* {
|
|
1157
|
+
* name: "name"
|
|
1158
|
+
* }
|
|
1159
|
+
*/
|
|
1160
|
+
interface EnvironmentWrite {
|
|
1161
|
+
id?: string;
|
|
1162
|
+
name: string;
|
|
1163
|
+
description?: string;
|
|
1164
|
+
color?: string;
|
|
1165
|
+
position?: number;
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
/**
|
|
1169
|
+
* @example
|
|
1170
|
+
* {}
|
|
1171
|
+
*/
|
|
1172
|
+
type GetEnvironmentByIdRequest = {};
|
|
1173
|
+
|
|
1141
1174
|
/**
|
|
1142
1175
|
* @example
|
|
1143
1176
|
* {
|
|
@@ -3812,6 +3845,7 @@ interface ChatCompletionChoice {
|
|
|
3812
3845
|
message?: AssistantMessage;
|
|
3813
3846
|
delta?: Delta;
|
|
3814
3847
|
finishReason?: string;
|
|
3848
|
+
logprobs?: LogProbs;
|
|
3815
3849
|
}
|
|
3816
3850
|
|
|
3817
3851
|
interface ChatCompletionResponse {
|
|
@@ -4424,6 +4458,26 @@ interface Delta {
|
|
|
4424
4458
|
functionCall?: FunctionCall;
|
|
4425
4459
|
}
|
|
4426
4460
|
|
|
4461
|
+
interface EnvironmentPagePublic {
|
|
4462
|
+
page?: number;
|
|
4463
|
+
size?: number;
|
|
4464
|
+
total?: number;
|
|
4465
|
+
content?: EnvironmentPublic[];
|
|
4466
|
+
sortableBy?: string[];
|
|
4467
|
+
}
|
|
4468
|
+
|
|
4469
|
+
interface EnvironmentPublic {
|
|
4470
|
+
id?: string;
|
|
4471
|
+
name: string;
|
|
4472
|
+
description?: string;
|
|
4473
|
+
color?: string;
|
|
4474
|
+
position?: number;
|
|
4475
|
+
createdAt?: Date;
|
|
4476
|
+
createdBy?: string;
|
|
4477
|
+
lastUpdatedAt?: Date;
|
|
4478
|
+
lastUpdatedBy?: string;
|
|
4479
|
+
}
|
|
4480
|
+
|
|
4427
4481
|
interface ErrorCountWithDeviation {
|
|
4428
4482
|
count?: number;
|
|
4429
4483
|
deviation?: number;
|
|
@@ -5471,6 +5525,16 @@ interface LogPage {
|
|
|
5471
5525
|
total?: number;
|
|
5472
5526
|
}
|
|
5473
5527
|
|
|
5528
|
+
interface LogProb {
|
|
5529
|
+
token?: string;
|
|
5530
|
+
logprob?: number;
|
|
5531
|
+
bytes?: number[];
|
|
5532
|
+
}
|
|
5533
|
+
|
|
5534
|
+
interface LogProbs {
|
|
5535
|
+
content?: LogProb[];
|
|
5536
|
+
}
|
|
5537
|
+
|
|
5474
5538
|
interface ManualEvaluationRequest {
|
|
5475
5539
|
/** Project ID */
|
|
5476
5540
|
projectId: string;
|
|
@@ -8722,6 +8786,86 @@ declare class DatasetsClient {
|
|
|
8722
8786
|
private __updateDatasetVersion;
|
|
8723
8787
|
}
|
|
8724
8788
|
|
|
8789
|
+
declare namespace EnvironmentsClient {
|
|
8790
|
+
type Options = BaseClientOptions;
|
|
8791
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8792
|
+
}
|
|
8793
|
+
}
|
|
8794
|
+
/**
|
|
8795
|
+
* Environment related resources
|
|
8796
|
+
*/
|
|
8797
|
+
declare class EnvironmentsClient {
|
|
8798
|
+
protected readonly _options: NormalizedClientOptions<EnvironmentsClient.Options>;
|
|
8799
|
+
constructor(options?: EnvironmentsClient.Options);
|
|
8800
|
+
/**
|
|
8801
|
+
* Find environments for the workspace. Capped at the workspace limit (default 20).
|
|
8802
|
+
*
|
|
8803
|
+
* @param {EnvironmentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
8804
|
+
*
|
|
8805
|
+
* @example
|
|
8806
|
+
* await client.environments.findEnvironments()
|
|
8807
|
+
*/
|
|
8808
|
+
findEnvironments(requestOptions?: EnvironmentsClient.RequestOptions): HttpResponsePromise<EnvironmentPagePublic>;
|
|
8809
|
+
private __findEnvironments;
|
|
8810
|
+
/**
|
|
8811
|
+
* Create environment
|
|
8812
|
+
*
|
|
8813
|
+
* @param {OpikApi.EnvironmentWrite} request
|
|
8814
|
+
* @param {EnvironmentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
8815
|
+
*
|
|
8816
|
+
* @throws {@link OpikApi.ConflictError}
|
|
8817
|
+
*
|
|
8818
|
+
* @example
|
|
8819
|
+
* await client.environments.createEnvironment({
|
|
8820
|
+
* name: "name"
|
|
8821
|
+
* })
|
|
8822
|
+
*/
|
|
8823
|
+
createEnvironment(request: EnvironmentWrite, requestOptions?: EnvironmentsClient.RequestOptions): HttpResponsePromise<void>;
|
|
8824
|
+
private __createEnvironment;
|
|
8825
|
+
/**
|
|
8826
|
+
* Delete environments batch. Idempotent — missing ids are silently ignored.
|
|
8827
|
+
*
|
|
8828
|
+
* @param {OpikApi.BatchDelete} request
|
|
8829
|
+
* @param {EnvironmentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
8830
|
+
*
|
|
8831
|
+
* @example
|
|
8832
|
+
* await client.environments.deleteEnvironmentsBatch({
|
|
8833
|
+
* ids: ["ids"]
|
|
8834
|
+
* })
|
|
8835
|
+
*/
|
|
8836
|
+
deleteEnvironmentsBatch(request: BatchDelete, requestOptions?: EnvironmentsClient.RequestOptions): HttpResponsePromise<void>;
|
|
8837
|
+
private __deleteEnvironmentsBatch;
|
|
8838
|
+
/**
|
|
8839
|
+
* Get environment by id
|
|
8840
|
+
*
|
|
8841
|
+
* @param {string} id
|
|
8842
|
+
* @param {OpikApi.GetEnvironmentByIdRequest} request
|
|
8843
|
+
* @param {EnvironmentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
8844
|
+
*
|
|
8845
|
+
* @throws {@link OpikApi.NotFoundError}
|
|
8846
|
+
*
|
|
8847
|
+
* @example
|
|
8848
|
+
* await client.environments.getEnvironmentById("id")
|
|
8849
|
+
*/
|
|
8850
|
+
getEnvironmentById(id: string, request?: GetEnvironmentByIdRequest, requestOptions?: EnvironmentsClient.RequestOptions): HttpResponsePromise<EnvironmentPublic>;
|
|
8851
|
+
private __getEnvironmentById;
|
|
8852
|
+
/**
|
|
8853
|
+
* Update environment by id
|
|
8854
|
+
*
|
|
8855
|
+
* @param {string} id
|
|
8856
|
+
* @param {OpikApi.EnvironmentUpdate} request
|
|
8857
|
+
* @param {EnvironmentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
8858
|
+
*
|
|
8859
|
+
* @throws {@link OpikApi.NotFoundError}
|
|
8860
|
+
* @throws {@link OpikApi.ConflictError}
|
|
8861
|
+
*
|
|
8862
|
+
* @example
|
|
8863
|
+
* await client.environments.updateEnvironment("id")
|
|
8864
|
+
*/
|
|
8865
|
+
updateEnvironment(id: string, request?: EnvironmentUpdate, requestOptions?: EnvironmentsClient.RequestOptions): HttpResponsePromise<void>;
|
|
8866
|
+
private __updateEnvironment;
|
|
8867
|
+
}
|
|
8868
|
+
|
|
8725
8869
|
declare namespace ExperimentsClient {
|
|
8726
8870
|
type Options = BaseClientOptions;
|
|
8727
8871
|
interface RequestOptions extends BaseRequestOptions {
|
|
@@ -11652,6 +11796,7 @@ declare class OpikApiClient {
|
|
|
11652
11796
|
protected _chatCompletions: ChatCompletionsClient | undefined;
|
|
11653
11797
|
protected _dashboards: DashboardsClient | undefined;
|
|
11654
11798
|
protected _datasets: DatasetsClient | undefined;
|
|
11799
|
+
protected _environments: EnvironmentsClient | undefined;
|
|
11655
11800
|
protected _experiments: ExperimentsClient | undefined;
|
|
11656
11801
|
protected _feedbackDefinitions: FeedbackDefinitionsClient | undefined;
|
|
11657
11802
|
protected _guardrails: GuardrailsClient | undefined;
|
|
@@ -11687,6 +11832,7 @@ declare class OpikApiClient {
|
|
|
11687
11832
|
get chatCompletions(): ChatCompletionsClient;
|
|
11688
11833
|
get dashboards(): DashboardsClient;
|
|
11689
11834
|
get datasets(): DatasetsClient;
|
|
11835
|
+
get environments(): EnvironmentsClient;
|
|
11690
11836
|
get experiments(): ExperimentsClient;
|
|
11691
11837
|
get feedbackDefinitions(): FeedbackDefinitionsClient;
|
|
11692
11838
|
get guardrails(): GuardrailsClient;
|
|
@@ -12257,6 +12403,15 @@ declare class Trace {
|
|
|
12257
12403
|
update: (updates: TraceUpdateData) => this;
|
|
12258
12404
|
}
|
|
12259
12405
|
|
|
12406
|
+
interface OpikApiClientTempOptions extends OpikApiClient.Options {
|
|
12407
|
+
requestOptions?: RequestOptions;
|
|
12408
|
+
}
|
|
12409
|
+
declare class OpikApiClientTemp extends OpikApiClient {
|
|
12410
|
+
requestOptions: RequestOptions;
|
|
12411
|
+
constructor(options?: OpikApiClientTempOptions);
|
|
12412
|
+
setHeaders: (headers: Record<string, string>) => void;
|
|
12413
|
+
}
|
|
12414
|
+
|
|
12260
12415
|
interface BatchQueueOptions {
|
|
12261
12416
|
delay?: number;
|
|
12262
12417
|
enableCreateBatch?: boolean;
|
|
@@ -12285,13 +12440,24 @@ declare abstract class BatchQueue<EntityData = object, EntityId = string> {
|
|
|
12285
12440
|
flush: () => Promise<void>;
|
|
12286
12441
|
}
|
|
12287
12442
|
|
|
12288
|
-
|
|
12289
|
-
|
|
12290
|
-
|
|
12291
|
-
|
|
12292
|
-
|
|
12293
|
-
|
|
12294
|
-
|
|
12443
|
+
type AssertionResultId = {
|
|
12444
|
+
entityId: string;
|
|
12445
|
+
name: string;
|
|
12446
|
+
};
|
|
12447
|
+
declare class AssertionResultsBatchQueue extends BatchQueue<AssertionResultBatchItem, AssertionResultId> {
|
|
12448
|
+
private readonly api;
|
|
12449
|
+
private readonly entityType;
|
|
12450
|
+
private useLegacyFallback;
|
|
12451
|
+
constructor(api: OpikApiClientTemp, delay?: number, entityType?: AssertionResultBatchEntityType);
|
|
12452
|
+
protected getId(entity: AssertionResultBatchItem): {
|
|
12453
|
+
entityId: string;
|
|
12454
|
+
name: string;
|
|
12455
|
+
};
|
|
12456
|
+
protected createEntities(assertionResults: AssertionResultBatchItem[]): Promise<void>;
|
|
12457
|
+
private writeViaLegacyFeedbackScores;
|
|
12458
|
+
protected getEntity(): Promise<AssertionResultBatchItem | undefined>;
|
|
12459
|
+
protected updateEntity(): Promise<void>;
|
|
12460
|
+
protected deleteEntities(): Promise<void>;
|
|
12295
12461
|
}
|
|
12296
12462
|
|
|
12297
12463
|
type SpanUpdate = Partial<SavedSpan> & {
|
|
@@ -12726,7 +12892,7 @@ type EvaluationScoreResult = {
|
|
|
12726
12892
|
reason?: string;
|
|
12727
12893
|
/** Whether the scoring failed */
|
|
12728
12894
|
scoringFailed?: boolean;
|
|
12729
|
-
/** Optional category name for grouping scores
|
|
12895
|
+
/** Optional category name for grouping scores */
|
|
12730
12896
|
categoryName?: string;
|
|
12731
12897
|
};
|
|
12732
12898
|
/**
|
|
@@ -13124,6 +13290,14 @@ declare abstract class BaseSuiteEvaluator extends BaseMetric {
|
|
|
13124
13290
|
readonly validationSchema: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
|
|
13125
13291
|
protected constructor(name: string, trackMetric?: boolean);
|
|
13126
13292
|
abstract toConfig(): LLMJudgeConfig;
|
|
13293
|
+
/**
|
|
13294
|
+
* Score the given input and return one or more assertion results.
|
|
13295
|
+
*
|
|
13296
|
+
* Each returned `EvaluationScoreResult.value` MUST be `0` (failed) or `1`
|
|
13297
|
+
* (passed) — suite evaluator outputs are routed to the assertion-results
|
|
13298
|
+
* endpoint where they are persisted as `passed | failed`. Non-binary values
|
|
13299
|
+
* are coerced to `failed` and logged as a warning.
|
|
13300
|
+
*/
|
|
13127
13301
|
abstract score(input: unknown): EvaluationScoreResult | EvaluationScoreResult[] | Promise<EvaluationScoreResult> | Promise<EvaluationScoreResult[]>;
|
|
13128
13302
|
}
|
|
13129
13303
|
|
|
@@ -13499,6 +13673,7 @@ declare class OpikClient {
|
|
|
13499
13673
|
traceBatchQueue: TraceBatchQueue;
|
|
13500
13674
|
spanFeedbackScoresBatchQueue: SpanFeedbackScoresBatchQueue;
|
|
13501
13675
|
traceFeedbackScoresBatchQueue: TraceFeedbackScoresBatchQueue;
|
|
13676
|
+
traceAssertionResultsBatchQueue: AssertionResultsBatchQueue;
|
|
13502
13677
|
datasetBatchQueue: DatasetBatchQueue;
|
|
13503
13678
|
private lastProjectNameLogged;
|
|
13504
13679
|
constructor(explicitConfig?: Partial<ConstructorOpikConfig>);
|
package/dist/index.d.ts
CHANGED
|
@@ -697,6 +697,8 @@ interface ChatCompletionRequest {
|
|
|
697
697
|
metadata?: Record<string, string>;
|
|
698
698
|
reasoningEffort?: string;
|
|
699
699
|
serviceTier?: string;
|
|
700
|
+
logprobs?: boolean;
|
|
701
|
+
topLogprobs?: number;
|
|
700
702
|
functions?: Function$1[];
|
|
701
703
|
functionCall?: FunctionCall;
|
|
702
704
|
}
|
|
@@ -1138,6 +1140,37 @@ declare const DatasetWriteVisibility: {
|
|
|
1138
1140
|
};
|
|
1139
1141
|
type DatasetWriteVisibility = (typeof DatasetWriteVisibility)[keyof typeof DatasetWriteVisibility];
|
|
1140
1142
|
|
|
1143
|
+
/**
|
|
1144
|
+
* @example
|
|
1145
|
+
* {}
|
|
1146
|
+
*/
|
|
1147
|
+
interface EnvironmentUpdate {
|
|
1148
|
+
name?: string;
|
|
1149
|
+
description?: string;
|
|
1150
|
+
color?: string;
|
|
1151
|
+
position?: number;
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
/**
|
|
1155
|
+
* @example
|
|
1156
|
+
* {
|
|
1157
|
+
* name: "name"
|
|
1158
|
+
* }
|
|
1159
|
+
*/
|
|
1160
|
+
interface EnvironmentWrite {
|
|
1161
|
+
id?: string;
|
|
1162
|
+
name: string;
|
|
1163
|
+
description?: string;
|
|
1164
|
+
color?: string;
|
|
1165
|
+
position?: number;
|
|
1166
|
+
}
|
|
1167
|
+
|
|
1168
|
+
/**
|
|
1169
|
+
* @example
|
|
1170
|
+
* {}
|
|
1171
|
+
*/
|
|
1172
|
+
type GetEnvironmentByIdRequest = {};
|
|
1173
|
+
|
|
1141
1174
|
/**
|
|
1142
1175
|
* @example
|
|
1143
1176
|
* {
|
|
@@ -3812,6 +3845,7 @@ interface ChatCompletionChoice {
|
|
|
3812
3845
|
message?: AssistantMessage;
|
|
3813
3846
|
delta?: Delta;
|
|
3814
3847
|
finishReason?: string;
|
|
3848
|
+
logprobs?: LogProbs;
|
|
3815
3849
|
}
|
|
3816
3850
|
|
|
3817
3851
|
interface ChatCompletionResponse {
|
|
@@ -4424,6 +4458,26 @@ interface Delta {
|
|
|
4424
4458
|
functionCall?: FunctionCall;
|
|
4425
4459
|
}
|
|
4426
4460
|
|
|
4461
|
+
interface EnvironmentPagePublic {
|
|
4462
|
+
page?: number;
|
|
4463
|
+
size?: number;
|
|
4464
|
+
total?: number;
|
|
4465
|
+
content?: EnvironmentPublic[];
|
|
4466
|
+
sortableBy?: string[];
|
|
4467
|
+
}
|
|
4468
|
+
|
|
4469
|
+
interface EnvironmentPublic {
|
|
4470
|
+
id?: string;
|
|
4471
|
+
name: string;
|
|
4472
|
+
description?: string;
|
|
4473
|
+
color?: string;
|
|
4474
|
+
position?: number;
|
|
4475
|
+
createdAt?: Date;
|
|
4476
|
+
createdBy?: string;
|
|
4477
|
+
lastUpdatedAt?: Date;
|
|
4478
|
+
lastUpdatedBy?: string;
|
|
4479
|
+
}
|
|
4480
|
+
|
|
4427
4481
|
interface ErrorCountWithDeviation {
|
|
4428
4482
|
count?: number;
|
|
4429
4483
|
deviation?: number;
|
|
@@ -5471,6 +5525,16 @@ interface LogPage {
|
|
|
5471
5525
|
total?: number;
|
|
5472
5526
|
}
|
|
5473
5527
|
|
|
5528
|
+
interface LogProb {
|
|
5529
|
+
token?: string;
|
|
5530
|
+
logprob?: number;
|
|
5531
|
+
bytes?: number[];
|
|
5532
|
+
}
|
|
5533
|
+
|
|
5534
|
+
interface LogProbs {
|
|
5535
|
+
content?: LogProb[];
|
|
5536
|
+
}
|
|
5537
|
+
|
|
5474
5538
|
interface ManualEvaluationRequest {
|
|
5475
5539
|
/** Project ID */
|
|
5476
5540
|
projectId: string;
|
|
@@ -8722,6 +8786,86 @@ declare class DatasetsClient {
|
|
|
8722
8786
|
private __updateDatasetVersion;
|
|
8723
8787
|
}
|
|
8724
8788
|
|
|
8789
|
+
declare namespace EnvironmentsClient {
|
|
8790
|
+
type Options = BaseClientOptions;
|
|
8791
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8792
|
+
}
|
|
8793
|
+
}
|
|
8794
|
+
/**
|
|
8795
|
+
* Environment related resources
|
|
8796
|
+
*/
|
|
8797
|
+
declare class EnvironmentsClient {
|
|
8798
|
+
protected readonly _options: NormalizedClientOptions<EnvironmentsClient.Options>;
|
|
8799
|
+
constructor(options?: EnvironmentsClient.Options);
|
|
8800
|
+
/**
|
|
8801
|
+
* Find environments for the workspace. Capped at the workspace limit (default 20).
|
|
8802
|
+
*
|
|
8803
|
+
* @param {EnvironmentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
8804
|
+
*
|
|
8805
|
+
* @example
|
|
8806
|
+
* await client.environments.findEnvironments()
|
|
8807
|
+
*/
|
|
8808
|
+
findEnvironments(requestOptions?: EnvironmentsClient.RequestOptions): HttpResponsePromise<EnvironmentPagePublic>;
|
|
8809
|
+
private __findEnvironments;
|
|
8810
|
+
/**
|
|
8811
|
+
* Create environment
|
|
8812
|
+
*
|
|
8813
|
+
* @param {OpikApi.EnvironmentWrite} request
|
|
8814
|
+
* @param {EnvironmentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
8815
|
+
*
|
|
8816
|
+
* @throws {@link OpikApi.ConflictError}
|
|
8817
|
+
*
|
|
8818
|
+
* @example
|
|
8819
|
+
* await client.environments.createEnvironment({
|
|
8820
|
+
* name: "name"
|
|
8821
|
+
* })
|
|
8822
|
+
*/
|
|
8823
|
+
createEnvironment(request: EnvironmentWrite, requestOptions?: EnvironmentsClient.RequestOptions): HttpResponsePromise<void>;
|
|
8824
|
+
private __createEnvironment;
|
|
8825
|
+
/**
|
|
8826
|
+
* Delete environments batch. Idempotent — missing ids are silently ignored.
|
|
8827
|
+
*
|
|
8828
|
+
* @param {OpikApi.BatchDelete} request
|
|
8829
|
+
* @param {EnvironmentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
8830
|
+
*
|
|
8831
|
+
* @example
|
|
8832
|
+
* await client.environments.deleteEnvironmentsBatch({
|
|
8833
|
+
* ids: ["ids"]
|
|
8834
|
+
* })
|
|
8835
|
+
*/
|
|
8836
|
+
deleteEnvironmentsBatch(request: BatchDelete, requestOptions?: EnvironmentsClient.RequestOptions): HttpResponsePromise<void>;
|
|
8837
|
+
private __deleteEnvironmentsBatch;
|
|
8838
|
+
/**
|
|
8839
|
+
* Get environment by id
|
|
8840
|
+
*
|
|
8841
|
+
* @param {string} id
|
|
8842
|
+
* @param {OpikApi.GetEnvironmentByIdRequest} request
|
|
8843
|
+
* @param {EnvironmentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
8844
|
+
*
|
|
8845
|
+
* @throws {@link OpikApi.NotFoundError}
|
|
8846
|
+
*
|
|
8847
|
+
* @example
|
|
8848
|
+
* await client.environments.getEnvironmentById("id")
|
|
8849
|
+
*/
|
|
8850
|
+
getEnvironmentById(id: string, request?: GetEnvironmentByIdRequest, requestOptions?: EnvironmentsClient.RequestOptions): HttpResponsePromise<EnvironmentPublic>;
|
|
8851
|
+
private __getEnvironmentById;
|
|
8852
|
+
/**
|
|
8853
|
+
* Update environment by id
|
|
8854
|
+
*
|
|
8855
|
+
* @param {string} id
|
|
8856
|
+
* @param {OpikApi.EnvironmentUpdate} request
|
|
8857
|
+
* @param {EnvironmentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
8858
|
+
*
|
|
8859
|
+
* @throws {@link OpikApi.NotFoundError}
|
|
8860
|
+
* @throws {@link OpikApi.ConflictError}
|
|
8861
|
+
*
|
|
8862
|
+
* @example
|
|
8863
|
+
* await client.environments.updateEnvironment("id")
|
|
8864
|
+
*/
|
|
8865
|
+
updateEnvironment(id: string, request?: EnvironmentUpdate, requestOptions?: EnvironmentsClient.RequestOptions): HttpResponsePromise<void>;
|
|
8866
|
+
private __updateEnvironment;
|
|
8867
|
+
}
|
|
8868
|
+
|
|
8725
8869
|
declare namespace ExperimentsClient {
|
|
8726
8870
|
type Options = BaseClientOptions;
|
|
8727
8871
|
interface RequestOptions extends BaseRequestOptions {
|
|
@@ -11652,6 +11796,7 @@ declare class OpikApiClient {
|
|
|
11652
11796
|
protected _chatCompletions: ChatCompletionsClient | undefined;
|
|
11653
11797
|
protected _dashboards: DashboardsClient | undefined;
|
|
11654
11798
|
protected _datasets: DatasetsClient | undefined;
|
|
11799
|
+
protected _environments: EnvironmentsClient | undefined;
|
|
11655
11800
|
protected _experiments: ExperimentsClient | undefined;
|
|
11656
11801
|
protected _feedbackDefinitions: FeedbackDefinitionsClient | undefined;
|
|
11657
11802
|
protected _guardrails: GuardrailsClient | undefined;
|
|
@@ -11687,6 +11832,7 @@ declare class OpikApiClient {
|
|
|
11687
11832
|
get chatCompletions(): ChatCompletionsClient;
|
|
11688
11833
|
get dashboards(): DashboardsClient;
|
|
11689
11834
|
get datasets(): DatasetsClient;
|
|
11835
|
+
get environments(): EnvironmentsClient;
|
|
11690
11836
|
get experiments(): ExperimentsClient;
|
|
11691
11837
|
get feedbackDefinitions(): FeedbackDefinitionsClient;
|
|
11692
11838
|
get guardrails(): GuardrailsClient;
|
|
@@ -12257,6 +12403,15 @@ declare class Trace {
|
|
|
12257
12403
|
update: (updates: TraceUpdateData) => this;
|
|
12258
12404
|
}
|
|
12259
12405
|
|
|
12406
|
+
interface OpikApiClientTempOptions extends OpikApiClient.Options {
|
|
12407
|
+
requestOptions?: RequestOptions;
|
|
12408
|
+
}
|
|
12409
|
+
declare class OpikApiClientTemp extends OpikApiClient {
|
|
12410
|
+
requestOptions: RequestOptions;
|
|
12411
|
+
constructor(options?: OpikApiClientTempOptions);
|
|
12412
|
+
setHeaders: (headers: Record<string, string>) => void;
|
|
12413
|
+
}
|
|
12414
|
+
|
|
12260
12415
|
interface BatchQueueOptions {
|
|
12261
12416
|
delay?: number;
|
|
12262
12417
|
enableCreateBatch?: boolean;
|
|
@@ -12285,13 +12440,24 @@ declare abstract class BatchQueue<EntityData = object, EntityId = string> {
|
|
|
12285
12440
|
flush: () => Promise<void>;
|
|
12286
12441
|
}
|
|
12287
12442
|
|
|
12288
|
-
|
|
12289
|
-
|
|
12290
|
-
|
|
12291
|
-
|
|
12292
|
-
|
|
12293
|
-
|
|
12294
|
-
|
|
12443
|
+
type AssertionResultId = {
|
|
12444
|
+
entityId: string;
|
|
12445
|
+
name: string;
|
|
12446
|
+
};
|
|
12447
|
+
declare class AssertionResultsBatchQueue extends BatchQueue<AssertionResultBatchItem, AssertionResultId> {
|
|
12448
|
+
private readonly api;
|
|
12449
|
+
private readonly entityType;
|
|
12450
|
+
private useLegacyFallback;
|
|
12451
|
+
constructor(api: OpikApiClientTemp, delay?: number, entityType?: AssertionResultBatchEntityType);
|
|
12452
|
+
protected getId(entity: AssertionResultBatchItem): {
|
|
12453
|
+
entityId: string;
|
|
12454
|
+
name: string;
|
|
12455
|
+
};
|
|
12456
|
+
protected createEntities(assertionResults: AssertionResultBatchItem[]): Promise<void>;
|
|
12457
|
+
private writeViaLegacyFeedbackScores;
|
|
12458
|
+
protected getEntity(): Promise<AssertionResultBatchItem | undefined>;
|
|
12459
|
+
protected updateEntity(): Promise<void>;
|
|
12460
|
+
protected deleteEntities(): Promise<void>;
|
|
12295
12461
|
}
|
|
12296
12462
|
|
|
12297
12463
|
type SpanUpdate = Partial<SavedSpan> & {
|
|
@@ -12726,7 +12892,7 @@ type EvaluationScoreResult = {
|
|
|
12726
12892
|
reason?: string;
|
|
12727
12893
|
/** Whether the scoring failed */
|
|
12728
12894
|
scoringFailed?: boolean;
|
|
12729
|
-
/** Optional category name for grouping scores
|
|
12895
|
+
/** Optional category name for grouping scores */
|
|
12730
12896
|
categoryName?: string;
|
|
12731
12897
|
};
|
|
12732
12898
|
/**
|
|
@@ -13124,6 +13290,14 @@ declare abstract class BaseSuiteEvaluator extends BaseMetric {
|
|
|
13124
13290
|
readonly validationSchema: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
|
|
13125
13291
|
protected constructor(name: string, trackMetric?: boolean);
|
|
13126
13292
|
abstract toConfig(): LLMJudgeConfig;
|
|
13293
|
+
/**
|
|
13294
|
+
* Score the given input and return one or more assertion results.
|
|
13295
|
+
*
|
|
13296
|
+
* Each returned `EvaluationScoreResult.value` MUST be `0` (failed) or `1`
|
|
13297
|
+
* (passed) — suite evaluator outputs are routed to the assertion-results
|
|
13298
|
+
* endpoint where they are persisted as `passed | failed`. Non-binary values
|
|
13299
|
+
* are coerced to `failed` and logged as a warning.
|
|
13300
|
+
*/
|
|
13127
13301
|
abstract score(input: unknown): EvaluationScoreResult | EvaluationScoreResult[] | Promise<EvaluationScoreResult> | Promise<EvaluationScoreResult[]>;
|
|
13128
13302
|
}
|
|
13129
13303
|
|
|
@@ -13499,6 +13673,7 @@ declare class OpikClient {
|
|
|
13499
13673
|
traceBatchQueue: TraceBatchQueue;
|
|
13500
13674
|
spanFeedbackScoresBatchQueue: SpanFeedbackScoresBatchQueue;
|
|
13501
13675
|
traceFeedbackScoresBatchQueue: TraceFeedbackScoresBatchQueue;
|
|
13676
|
+
traceAssertionResultsBatchQueue: AssertionResultsBatchQueue;
|
|
13502
13677
|
datasetBatchQueue: DatasetBatchQueue;
|
|
13503
13678
|
private lastProjectNameLogged;
|
|
13504
13679
|
constructor(explicitConfig?: Partial<ConstructorOpikConfig>);
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {Ea}from'./chunk-
|
|
1
|
+
import {Ea}from'./chunk-XQEUQ5J4.js';export{ra as AgentTaskCompletionJudge,qa as AgentToolCorrectnessJudge,ea as AnswerRelevance,aa as BaseLLMJudgeMetric,B as BaseMetric,C as BaseSuiteEvaluator,p as ChatPrompt,ta as ComplianceRiskJudge,i as ConfigMismatchError,h as ConfigNotFoundError,Z as Contains,y as DEFAULT_EXECUTION_POLICY,j as Dataset,f as DatasetVersion,g as DatasetVersionNotFoundError,la as DemographicBiasJudge,ja as DialogueHelpfulnessJudge,Y as ExactMatch,fa as GEval,ga as GEvalPreset,na as GenderBiasJudge,da as Hallucination,$ as IsJson,P as LLMJudge,G as ModelConfigurationError,E as ModelError,F as ModelGenerationError,ba as Moderation,Ba as OPIK_PARENT_SPAN_ID_HEADER,Aa as OPIK_TRACE_ID_HEADER,za as Opik,D as OpikBaseModel,q as OpikQueryLanguage,d as OpikSpanType,ma as PoliticalBiasJudge,o as Prompt,k as PromptType,sa as PromptUncertaintyJudge,ka as QARelevanceJudge,_ as RegexMatch,pa as RegionalBiasJudge,oa as ReligiousBiasJudge,O as ResponseSchema,M as SYSTEM_PROMPT,ia as SummarizationCoherenceJudge,ha as SummarizationConsistencyJudge,xa as TestSuite,z as TestSuiteResult,s as ThreadsAnnotationQueue,r as TracesAnnotationQueue,N as USER_PROMPT_TEMPLATE,ca as Usefulness,I as VercelAIChatModel,v as activateRunner,t as agentConfigContext,A as buildSuiteResult,J as createModel,K as createModelFromInstance,R as deserializeEvaluators,H as detectProvider,c as disableLogger,W as evaluate,X as evaluatePrompt,U as evaluateTestSuite,u as flushAll,e as generateId,Ca as getDistributedTraceHeaders,l as getGlobalClient,w as getTrackContext,a as logger,n as resetGlobalClient,ua as resolveEvaluators,S as resolveExecutionPolicy,T as resolveItemExecutionPolicy,L as resolveModel,V as runTests,Q as serializeEvaluators,m as setGlobalClient,b as setLoggerLevel,x as track,va as validateEvaluators,wa as validateExecutionPolicy,Da as z}from'./chunk-XQEUQ5J4.js';Ea();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {ya}from'./chunk-
|
|
1
|
+
import {ya}from'./chunk-XQEUQ5J4.js';export{y as DEFAULT_EXECUTION_POLICY,xa as TestSuite,z as TestSuiteResult,A as buildSuiteResult,R as deserializeEvaluators,U as evaluateTestSuite,S as resolveExecutionPolicy,T as resolveItemExecutionPolicy,V as runTests,Q as serializeEvaluators}from'./chunk-XQEUQ5J4.js';ya();
|