opik 1.7.5 → 1.7.7

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.
@@ -941,6 +941,31 @@ interface ExperimentStreamRequestPublic {
941
941
  lastRetrievedId?: string;
942
942
  }
943
943
 
944
+ /**
945
+ * This file was auto-generated by Fern from our API Definition.
946
+ */
947
+
948
+ /**
949
+ * @example
950
+ * {
951
+ * guardrails: [{
952
+ * entityId: "entity_id",
953
+ * secondaryId: "secondary_id",
954
+ * name: "TOPIC",
955
+ * result: "passed",
956
+ * config: {
957
+ * "key": "value"
958
+ * },
959
+ * details: {
960
+ * "key": "value"
961
+ * }
962
+ * }]
963
+ * }
964
+ */
965
+ interface GuardrailBatch {
966
+ guardrails: GuardrailBatchItem[];
967
+ }
968
+
944
969
  /**
945
970
  * This file was auto-generated by Fern from our API Definition.
946
971
  */
@@ -2474,6 +2499,40 @@ interface NumericalFeedbackDetailUpdate {
2474
2499
  min: number;
2475
2500
  }
2476
2501
 
2502
+ /**
2503
+ * This file was auto-generated by Fern from our API Definition.
2504
+ */
2505
+ type GuardrailBatchItemName = "TOPIC" | "PII";
2506
+ declare const GuardrailBatchItemName: {
2507
+ readonly Topic: "TOPIC";
2508
+ readonly Pii: "PII";
2509
+ };
2510
+
2511
+ /**
2512
+ * This file was auto-generated by Fern from our API Definition.
2513
+ */
2514
+ type GuardrailBatchItemResult = "passed" | "failed";
2515
+ declare const GuardrailBatchItemResult: {
2516
+ readonly Passed: "passed";
2517
+ readonly Failed: "failed";
2518
+ };
2519
+
2520
+ /**
2521
+ * This file was auto-generated by Fern from our API Definition.
2522
+ */
2523
+
2524
+ interface GuardrailBatchItem {
2525
+ id?: string;
2526
+ entityId: string;
2527
+ secondaryId: string;
2528
+ /** If null, the default project is used */
2529
+ projectName?: string;
2530
+ name: GuardrailBatchItemName;
2531
+ result: GuardrailBatchItemResult;
2532
+ config: JsonNode;
2533
+ details: JsonNode;
2534
+ }
2535
+
2477
2536
  /**
2478
2537
  * This file was auto-generated by Fern from our API Definition.
2479
2538
  */
@@ -3132,6 +3191,42 @@ interface SpanFilterPublic {
3132
3191
  value?: string;
3133
3192
  }
3134
3193
 
3194
+ /**
3195
+ * This file was auto-generated by Fern from our API Definition.
3196
+ */
3197
+ type CheckName = "TOPIC" | "PII";
3198
+ declare const CheckName: {
3199
+ readonly Topic: "TOPIC";
3200
+ readonly Pii: "PII";
3201
+ };
3202
+
3203
+ /**
3204
+ * This file was auto-generated by Fern from our API Definition.
3205
+ */
3206
+ type CheckResult = "passed" | "failed";
3207
+ declare const CheckResult: {
3208
+ readonly Passed: "passed";
3209
+ readonly Failed: "failed";
3210
+ };
3211
+
3212
+ /**
3213
+ * This file was auto-generated by Fern from our API Definition.
3214
+ */
3215
+
3216
+ interface Check$1 {
3217
+ name?: CheckName;
3218
+ result?: CheckResult;
3219
+ }
3220
+
3221
+ /**
3222
+ * This file was auto-generated by Fern from our API Definition.
3223
+ */
3224
+
3225
+ interface GuardrailsValidation {
3226
+ spanId?: string;
3227
+ checks?: Check$1[];
3228
+ }
3229
+
3135
3230
  /**
3136
3231
  * This file was auto-generated by Fern from our API Definition.
3137
3232
  */
@@ -3156,6 +3251,7 @@ interface Trace$1 {
3156
3251
  lastUpdatedBy?: string;
3157
3252
  feedbackScores?: FeedbackScore[];
3158
3253
  comments?: Comment[];
3254
+ guardrailsValidations?: GuardrailsValidation[];
3159
3255
  totalEstimatedCost?: number;
3160
3256
  spanCount?: number;
3161
3257
  /** Duration in milliseconds as a decimal number to support sub-millisecond precision */
@@ -3182,6 +3278,42 @@ interface TraceWrite {
3182
3278
  threadId?: string;
3183
3279
  }
3184
3280
 
3281
+ /**
3282
+ * This file was auto-generated by Fern from our API Definition.
3283
+ */
3284
+ type CheckPublicName = "TOPIC" | "PII";
3285
+ declare const CheckPublicName: {
3286
+ readonly Topic: "TOPIC";
3287
+ readonly Pii: "PII";
3288
+ };
3289
+
3290
+ /**
3291
+ * This file was auto-generated by Fern from our API Definition.
3292
+ */
3293
+ type CheckPublicResult = "passed" | "failed";
3294
+ declare const CheckPublicResult: {
3295
+ readonly Passed: "passed";
3296
+ readonly Failed: "failed";
3297
+ };
3298
+
3299
+ /**
3300
+ * This file was auto-generated by Fern from our API Definition.
3301
+ */
3302
+
3303
+ interface CheckPublic {
3304
+ name?: CheckPublicName;
3305
+ result?: CheckPublicResult;
3306
+ }
3307
+
3308
+ /**
3309
+ * This file was auto-generated by Fern from our API Definition.
3310
+ */
3311
+
3312
+ interface GuardrailsValidationPublic {
3313
+ spanId?: string;
3314
+ checks?: CheckPublic[];
3315
+ }
3316
+
3185
3317
  /**
3186
3318
  * This file was auto-generated by Fern from our API Definition.
3187
3319
  */
@@ -3204,6 +3336,7 @@ interface TracePublic {
3204
3336
  lastUpdatedBy?: string;
3205
3337
  feedbackScores?: FeedbackScorePublic[];
3206
3338
  comments?: CommentPublic[];
3339
+ guardrailsValidations?: GuardrailsValidationPublic[];
3207
3340
  totalEstimatedCost?: number;
3208
3341
  spanCount?: number;
3209
3342
  /** Duration in milliseconds as a decimal number to support sub-millisecond precision */
@@ -4223,6 +4356,69 @@ declare class FeedbackDefinitions {
4223
4356
  }>;
4224
4357
  }
4225
4358
 
4359
+ /**
4360
+ * This file was auto-generated by Fern from our API Definition.
4361
+ */
4362
+
4363
+ declare namespace Guardrails {
4364
+ interface Options {
4365
+ environment?: Supplier<OpikApiEnvironment | string>;
4366
+ /** Specify a custom URL to connect the client to. */
4367
+ baseUrl?: Supplier<string>;
4368
+ /** Override the Authorization header */
4369
+ apiKey?: Supplier<string | undefined>;
4370
+ /** Override the Comet-Workspace header */
4371
+ workspaceName?: Supplier<string | undefined>;
4372
+ }
4373
+ interface RequestOptions {
4374
+ /** The maximum time to wait for a response in seconds. */
4375
+ timeoutInSeconds?: number;
4376
+ /** The number of times to retry the request. Defaults to 2. */
4377
+ maxRetries?: number;
4378
+ /** A hook to abort the request. */
4379
+ abortSignal?: AbortSignal;
4380
+ /** Override the Authorization header */
4381
+ apiKey?: string | undefined;
4382
+ /** Override the Comet-Workspace header */
4383
+ workspaceName?: string | undefined;
4384
+ /** Additional headers to include in the request. */
4385
+ headers?: Record<string, string>;
4386
+ }
4387
+ }
4388
+ /**
4389
+ * Guardrails related resources
4390
+ */
4391
+ declare class Guardrails {
4392
+ protected readonly _options: Guardrails.Options;
4393
+ constructor(_options?: Guardrails.Options);
4394
+ /**
4395
+ * Batch guardrails for traces
4396
+ *
4397
+ * @param {OpikApi.GuardrailBatch} request
4398
+ * @param {Guardrails.RequestOptions} requestOptions - Request-specific configuration.
4399
+ *
4400
+ * @example
4401
+ * await client.guardrails.addGuardrailsBatch({
4402
+ * guardrails: [{
4403
+ * entityId: "entity_id",
4404
+ * secondaryId: "secondary_id",
4405
+ * name: "TOPIC",
4406
+ * result: "passed",
4407
+ * config: {
4408
+ * "key": "value"
4409
+ * },
4410
+ * details: {
4411
+ * "key": "value"
4412
+ * }
4413
+ * }]
4414
+ * })
4415
+ */
4416
+ addGuardrailsBatch(request: GuardrailBatch, requestOptions?: Guardrails.RequestOptions): Promise<void>;
4417
+ protected _getCustomAuthorizationHeaders(): Promise<{
4418
+ Authorization: string | undefined;
4419
+ }>;
4420
+ }
4421
+
4226
4422
  /**
4227
4423
  * This file was auto-generated by Fern from our API Definition.
4228
4424
  */
@@ -5420,6 +5616,7 @@ declare class OpikApiClient {
5420
5616
  protected _datasets: Datasets | undefined;
5421
5617
  protected _experiments: Experiments | undefined;
5422
5618
  protected _feedbackDefinitions: FeedbackDefinitions | undefined;
5619
+ protected _guardrails: Guardrails | undefined;
5423
5620
  protected _llmProviderKey: LlmProviderKey | undefined;
5424
5621
  protected _openTelemetryIngestion: OpenTelemetryIngestion | undefined;
5425
5622
  protected _projects: Projects | undefined;
@@ -5437,6 +5634,7 @@ declare class OpikApiClient {
5437
5634
  get datasets(): Datasets;
5438
5635
  get experiments(): Experiments;
5439
5636
  get feedbackDefinitions(): FeedbackDefinitions;
5637
+ get guardrails(): Guardrails;
5440
5638
  get llmProviderKey(): LlmProviderKey;
5441
5639
  get openTelemetryIngestion(): OpenTelemetryIngestion;
5442
5640
  get projects(): Projects;
@@ -941,6 +941,31 @@ interface ExperimentStreamRequestPublic {
941
941
  lastRetrievedId?: string;
942
942
  }
943
943
 
944
+ /**
945
+ * This file was auto-generated by Fern from our API Definition.
946
+ */
947
+
948
+ /**
949
+ * @example
950
+ * {
951
+ * guardrails: [{
952
+ * entityId: "entity_id",
953
+ * secondaryId: "secondary_id",
954
+ * name: "TOPIC",
955
+ * result: "passed",
956
+ * config: {
957
+ * "key": "value"
958
+ * },
959
+ * details: {
960
+ * "key": "value"
961
+ * }
962
+ * }]
963
+ * }
964
+ */
965
+ interface GuardrailBatch {
966
+ guardrails: GuardrailBatchItem[];
967
+ }
968
+
944
969
  /**
945
970
  * This file was auto-generated by Fern from our API Definition.
946
971
  */
@@ -2474,6 +2499,40 @@ interface NumericalFeedbackDetailUpdate {
2474
2499
  min: number;
2475
2500
  }
2476
2501
 
2502
+ /**
2503
+ * This file was auto-generated by Fern from our API Definition.
2504
+ */
2505
+ type GuardrailBatchItemName = "TOPIC" | "PII";
2506
+ declare const GuardrailBatchItemName: {
2507
+ readonly Topic: "TOPIC";
2508
+ readonly Pii: "PII";
2509
+ };
2510
+
2511
+ /**
2512
+ * This file was auto-generated by Fern from our API Definition.
2513
+ */
2514
+ type GuardrailBatchItemResult = "passed" | "failed";
2515
+ declare const GuardrailBatchItemResult: {
2516
+ readonly Passed: "passed";
2517
+ readonly Failed: "failed";
2518
+ };
2519
+
2520
+ /**
2521
+ * This file was auto-generated by Fern from our API Definition.
2522
+ */
2523
+
2524
+ interface GuardrailBatchItem {
2525
+ id?: string;
2526
+ entityId: string;
2527
+ secondaryId: string;
2528
+ /** If null, the default project is used */
2529
+ projectName?: string;
2530
+ name: GuardrailBatchItemName;
2531
+ result: GuardrailBatchItemResult;
2532
+ config: JsonNode;
2533
+ details: JsonNode;
2534
+ }
2535
+
2477
2536
  /**
2478
2537
  * This file was auto-generated by Fern from our API Definition.
2479
2538
  */
@@ -3132,6 +3191,42 @@ interface SpanFilterPublic {
3132
3191
  value?: string;
3133
3192
  }
3134
3193
 
3194
+ /**
3195
+ * This file was auto-generated by Fern from our API Definition.
3196
+ */
3197
+ type CheckName = "TOPIC" | "PII";
3198
+ declare const CheckName: {
3199
+ readonly Topic: "TOPIC";
3200
+ readonly Pii: "PII";
3201
+ };
3202
+
3203
+ /**
3204
+ * This file was auto-generated by Fern from our API Definition.
3205
+ */
3206
+ type CheckResult = "passed" | "failed";
3207
+ declare const CheckResult: {
3208
+ readonly Passed: "passed";
3209
+ readonly Failed: "failed";
3210
+ };
3211
+
3212
+ /**
3213
+ * This file was auto-generated by Fern from our API Definition.
3214
+ */
3215
+
3216
+ interface Check$1 {
3217
+ name?: CheckName;
3218
+ result?: CheckResult;
3219
+ }
3220
+
3221
+ /**
3222
+ * This file was auto-generated by Fern from our API Definition.
3223
+ */
3224
+
3225
+ interface GuardrailsValidation {
3226
+ spanId?: string;
3227
+ checks?: Check$1[];
3228
+ }
3229
+
3135
3230
  /**
3136
3231
  * This file was auto-generated by Fern from our API Definition.
3137
3232
  */
@@ -3156,6 +3251,7 @@ interface Trace$1 {
3156
3251
  lastUpdatedBy?: string;
3157
3252
  feedbackScores?: FeedbackScore[];
3158
3253
  comments?: Comment[];
3254
+ guardrailsValidations?: GuardrailsValidation[];
3159
3255
  totalEstimatedCost?: number;
3160
3256
  spanCount?: number;
3161
3257
  /** Duration in milliseconds as a decimal number to support sub-millisecond precision */
@@ -3182,6 +3278,42 @@ interface TraceWrite {
3182
3278
  threadId?: string;
3183
3279
  }
3184
3280
 
3281
+ /**
3282
+ * This file was auto-generated by Fern from our API Definition.
3283
+ */
3284
+ type CheckPublicName = "TOPIC" | "PII";
3285
+ declare const CheckPublicName: {
3286
+ readonly Topic: "TOPIC";
3287
+ readonly Pii: "PII";
3288
+ };
3289
+
3290
+ /**
3291
+ * This file was auto-generated by Fern from our API Definition.
3292
+ */
3293
+ type CheckPublicResult = "passed" | "failed";
3294
+ declare const CheckPublicResult: {
3295
+ readonly Passed: "passed";
3296
+ readonly Failed: "failed";
3297
+ };
3298
+
3299
+ /**
3300
+ * This file was auto-generated by Fern from our API Definition.
3301
+ */
3302
+
3303
+ interface CheckPublic {
3304
+ name?: CheckPublicName;
3305
+ result?: CheckPublicResult;
3306
+ }
3307
+
3308
+ /**
3309
+ * This file was auto-generated by Fern from our API Definition.
3310
+ */
3311
+
3312
+ interface GuardrailsValidationPublic {
3313
+ spanId?: string;
3314
+ checks?: CheckPublic[];
3315
+ }
3316
+
3185
3317
  /**
3186
3318
  * This file was auto-generated by Fern from our API Definition.
3187
3319
  */
@@ -3204,6 +3336,7 @@ interface TracePublic {
3204
3336
  lastUpdatedBy?: string;
3205
3337
  feedbackScores?: FeedbackScorePublic[];
3206
3338
  comments?: CommentPublic[];
3339
+ guardrailsValidations?: GuardrailsValidationPublic[];
3207
3340
  totalEstimatedCost?: number;
3208
3341
  spanCount?: number;
3209
3342
  /** Duration in milliseconds as a decimal number to support sub-millisecond precision */
@@ -4223,6 +4356,69 @@ declare class FeedbackDefinitions {
4223
4356
  }>;
4224
4357
  }
4225
4358
 
4359
+ /**
4360
+ * This file was auto-generated by Fern from our API Definition.
4361
+ */
4362
+
4363
+ declare namespace Guardrails {
4364
+ interface Options {
4365
+ environment?: Supplier<OpikApiEnvironment | string>;
4366
+ /** Specify a custom URL to connect the client to. */
4367
+ baseUrl?: Supplier<string>;
4368
+ /** Override the Authorization header */
4369
+ apiKey?: Supplier<string | undefined>;
4370
+ /** Override the Comet-Workspace header */
4371
+ workspaceName?: Supplier<string | undefined>;
4372
+ }
4373
+ interface RequestOptions {
4374
+ /** The maximum time to wait for a response in seconds. */
4375
+ timeoutInSeconds?: number;
4376
+ /** The number of times to retry the request. Defaults to 2. */
4377
+ maxRetries?: number;
4378
+ /** A hook to abort the request. */
4379
+ abortSignal?: AbortSignal;
4380
+ /** Override the Authorization header */
4381
+ apiKey?: string | undefined;
4382
+ /** Override the Comet-Workspace header */
4383
+ workspaceName?: string | undefined;
4384
+ /** Additional headers to include in the request. */
4385
+ headers?: Record<string, string>;
4386
+ }
4387
+ }
4388
+ /**
4389
+ * Guardrails related resources
4390
+ */
4391
+ declare class Guardrails {
4392
+ protected readonly _options: Guardrails.Options;
4393
+ constructor(_options?: Guardrails.Options);
4394
+ /**
4395
+ * Batch guardrails for traces
4396
+ *
4397
+ * @param {OpikApi.GuardrailBatch} request
4398
+ * @param {Guardrails.RequestOptions} requestOptions - Request-specific configuration.
4399
+ *
4400
+ * @example
4401
+ * await client.guardrails.addGuardrailsBatch({
4402
+ * guardrails: [{
4403
+ * entityId: "entity_id",
4404
+ * secondaryId: "secondary_id",
4405
+ * name: "TOPIC",
4406
+ * result: "passed",
4407
+ * config: {
4408
+ * "key": "value"
4409
+ * },
4410
+ * details: {
4411
+ * "key": "value"
4412
+ * }
4413
+ * }]
4414
+ * })
4415
+ */
4416
+ addGuardrailsBatch(request: GuardrailBatch, requestOptions?: Guardrails.RequestOptions): Promise<void>;
4417
+ protected _getCustomAuthorizationHeaders(): Promise<{
4418
+ Authorization: string | undefined;
4419
+ }>;
4420
+ }
4421
+
4226
4422
  /**
4227
4423
  * This file was auto-generated by Fern from our API Definition.
4228
4424
  */
@@ -5420,6 +5616,7 @@ declare class OpikApiClient {
5420
5616
  protected _datasets: Datasets | undefined;
5421
5617
  protected _experiments: Experiments | undefined;
5422
5618
  protected _feedbackDefinitions: FeedbackDefinitions | undefined;
5619
+ protected _guardrails: Guardrails | undefined;
5423
5620
  protected _llmProviderKey: LlmProviderKey | undefined;
5424
5621
  protected _openTelemetryIngestion: OpenTelemetryIngestion | undefined;
5425
5622
  protected _projects: Projects | undefined;
@@ -5437,6 +5634,7 @@ declare class OpikApiClient {
5437
5634
  get datasets(): Datasets;
5438
5635
  get experiments(): Experiments;
5439
5636
  get feedbackDefinitions(): FeedbackDefinitions;
5637
+ get guardrails(): Guardrails;
5440
5638
  get llmProviderKey(): LlmProviderKey;
5441
5639
  get openTelemetryIngestion(): OpenTelemetryIngestion;
5442
5640
  get projects(): Projects;