opik 1.8.58 → 1.8.59

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.
@@ -336,6 +336,39 @@ declare const ExperimentWriteType: {
336
336
  readonly MiniBatch: "mini-batch";
337
337
  };
338
338
 
339
+ /**
340
+ * This file was auto-generated by Fern from our API Definition.
341
+ */
342
+ type ExperimentWriteStatus = "running" | "completed" | "cancelled";
343
+ declare const ExperimentWriteStatus: {
344
+ readonly Running: "running";
345
+ readonly Completed: "completed";
346
+ readonly Cancelled: "cancelled";
347
+ };
348
+
349
+ /**
350
+ * This file was auto-generated by Fern from our API Definition.
351
+ */
352
+ type ExperimentUpdateType = "regular" | "trial" | "mini-batch";
353
+ declare const ExperimentUpdateType: {
354
+ readonly Regular: "regular";
355
+ readonly Trial: "trial";
356
+ readonly MiniBatch: "mini-batch";
357
+ };
358
+
359
+ /**
360
+ * This file was auto-generated by Fern from our API Definition.
361
+ */
362
+ /**
363
+ * The status of the experiment
364
+ */
365
+ type ExperimentUpdateStatus = "running" | "completed" | "cancelled";
366
+ declare const ExperimentUpdateStatus: {
367
+ readonly Running: "running";
368
+ readonly Completed: "completed";
369
+ readonly Cancelled: "cancelled";
370
+ };
371
+
339
372
  /**
340
373
  * This file was auto-generated by Fern from our API Definition.
341
374
  */
@@ -373,6 +406,7 @@ interface ExperimentWrite {
373
406
  metadata?: JsonListStringWrite;
374
407
  type?: ExperimentWriteType;
375
408
  optimizationId?: string;
409
+ status?: ExperimentWriteStatus;
376
410
  promptVersion?: PromptVersionLinkWrite;
377
411
  promptVersions?: PromptVersionLinkWrite[];
378
412
  }
@@ -469,6 +503,22 @@ interface FindExperimentGroupsAggregationsRequest {
469
503
  filters?: string;
470
504
  }
471
505
 
506
+ /**
507
+ * This file was auto-generated by Fern from our API Definition.
508
+ */
509
+
510
+ /**
511
+ * @example
512
+ * {}
513
+ */
514
+ interface ExperimentUpdate {
515
+ name?: string;
516
+ metadata?: JsonNode;
517
+ type?: ExperimentUpdateType;
518
+ /** The status of the experiment */
519
+ status?: ExperimentUpdateStatus;
520
+ }
521
+
472
522
  /**
473
523
  * This file was auto-generated by Fern from our API Definition.
474
524
  */
@@ -1014,6 +1064,28 @@ interface SpanSearchStreamRequestPublic {
1014
1064
  truncate?: boolean;
1015
1065
  }
1016
1066
 
1067
+ /**
1068
+ * This file was auto-generated by Fern from our API Definition.
1069
+ */
1070
+
1071
+ /**
1072
+ * @example
1073
+ * {
1074
+ * name: "name",
1075
+ * webhook: {
1076
+ * url: "url",
1077
+ * secretToken: "secret_token"
1078
+ * }
1079
+ * }
1080
+ */
1081
+ interface AlertWrite {
1082
+ id?: string;
1083
+ name: string;
1084
+ enabled?: boolean;
1085
+ webhook: WebhookWrite;
1086
+ triggers?: AlertTriggerWrite[];
1087
+ }
1088
+
1017
1089
  /**
1018
1090
  * This file was auto-generated by Fern from our API Definition.
1019
1091
  */
@@ -1514,6 +1586,149 @@ interface WorkspaceTraceCount {
1514
1586
  traceCount?: number;
1515
1587
  }
1516
1588
 
1589
+ /**
1590
+ * This file was auto-generated by Fern from our API Definition.
1591
+ */
1592
+ type AlertTriggerConfigWriteType = "scope:project" | "threshold:feedback_score";
1593
+ declare const AlertTriggerConfigWriteType: {
1594
+ readonly ScopeProject: "scope:project";
1595
+ readonly ThresholdFeedbackScore: "threshold:feedback_score";
1596
+ };
1597
+
1598
+ /**
1599
+ * This file was auto-generated by Fern from our API Definition.
1600
+ */
1601
+
1602
+ interface AlertTriggerConfigWrite {
1603
+ id?: string;
1604
+ type: AlertTriggerConfigWriteType;
1605
+ configValue?: Record<string, string>;
1606
+ }
1607
+
1608
+ /**
1609
+ * This file was auto-generated by Fern from our API Definition.
1610
+ */
1611
+ type AlertTriggerWriteEventType = "trace:errors" | "trace:feedback_score" | "trace_thread:feedback_score" | "prompt:created" | "prompt:committed" | "span:guardrails_triggered" | "prompt:deleted";
1612
+ declare const AlertTriggerWriteEventType: {
1613
+ readonly TraceErrors: "trace:errors";
1614
+ readonly TraceFeedbackScore: "trace:feedback_score";
1615
+ readonly TraceThreadFeedbackScore: "trace_thread:feedback_score";
1616
+ readonly PromptCreated: "prompt:created";
1617
+ readonly PromptCommitted: "prompt:committed";
1618
+ readonly SpanGuardrailsTriggered: "span:guardrails_triggered";
1619
+ readonly PromptDeleted: "prompt:deleted";
1620
+ };
1621
+
1622
+ /**
1623
+ * This file was auto-generated by Fern from our API Definition.
1624
+ */
1625
+
1626
+ interface AlertTriggerWrite {
1627
+ id?: string;
1628
+ eventType: AlertTriggerWriteEventType;
1629
+ triggerConfigs?: AlertTriggerConfigWrite[];
1630
+ }
1631
+
1632
+ /**
1633
+ * This file was auto-generated by Fern from our API Definition.
1634
+ */
1635
+ interface WebhookWrite {
1636
+ id?: string;
1637
+ name?: string;
1638
+ url: string;
1639
+ secretToken: string;
1640
+ headers?: Record<string, string>;
1641
+ }
1642
+
1643
+ /**
1644
+ * This file was auto-generated by Fern from our API Definition.
1645
+ */
1646
+ interface BatchDelete {
1647
+ ids: string[];
1648
+ }
1649
+
1650
+ /**
1651
+ * This file was auto-generated by Fern from our API Definition.
1652
+ */
1653
+ type AlertTriggerConfigPublicType = "scope:project" | "threshold:feedback_score";
1654
+ declare const AlertTriggerConfigPublicType: {
1655
+ readonly ScopeProject: "scope:project";
1656
+ readonly ThresholdFeedbackScore: "threshold:feedback_score";
1657
+ };
1658
+
1659
+ /**
1660
+ * This file was auto-generated by Fern from our API Definition.
1661
+ */
1662
+
1663
+ interface AlertTriggerConfigPublic {
1664
+ id?: string;
1665
+ alertTriggerId?: string;
1666
+ type: AlertTriggerConfigPublicType;
1667
+ configValue?: Record<string, string>;
1668
+ createdAt?: Date;
1669
+ createdBy?: string;
1670
+ lastUpdatedAt?: Date;
1671
+ lastUpdatedBy?: string;
1672
+ }
1673
+
1674
+ /**
1675
+ * This file was auto-generated by Fern from our API Definition.
1676
+ */
1677
+ type AlertTriggerPublicEventType = "trace:errors" | "trace:feedback_score" | "trace_thread:feedback_score" | "prompt:created" | "prompt:committed" | "span:guardrails_triggered" | "prompt:deleted";
1678
+ declare const AlertTriggerPublicEventType: {
1679
+ readonly TraceErrors: "trace:errors";
1680
+ readonly TraceFeedbackScore: "trace:feedback_score";
1681
+ readonly TraceThreadFeedbackScore: "trace_thread:feedback_score";
1682
+ readonly PromptCreated: "prompt:created";
1683
+ readonly PromptCommitted: "prompt:committed";
1684
+ readonly SpanGuardrailsTriggered: "span:guardrails_triggered";
1685
+ readonly PromptDeleted: "prompt:deleted";
1686
+ };
1687
+
1688
+ /**
1689
+ * This file was auto-generated by Fern from our API Definition.
1690
+ */
1691
+
1692
+ interface AlertTriggerPublic {
1693
+ id?: string;
1694
+ alertId?: string;
1695
+ eventType: AlertTriggerPublicEventType;
1696
+ triggerConfigs?: AlertTriggerConfigPublic[];
1697
+ createdAt?: Date;
1698
+ createdBy?: string;
1699
+ }
1700
+
1701
+ /**
1702
+ * This file was auto-generated by Fern from our API Definition.
1703
+ */
1704
+
1705
+ interface AlertPublic {
1706
+ id?: string;
1707
+ name: string;
1708
+ enabled?: boolean;
1709
+ webhook: WebhookPublic;
1710
+ triggers?: AlertTriggerPublic[];
1711
+ createdAt?: Date;
1712
+ createdBy?: string;
1713
+ lastUpdatedAt?: Date;
1714
+ lastUpdatedBy?: string;
1715
+ }
1716
+
1717
+ /**
1718
+ * This file was auto-generated by Fern from our API Definition.
1719
+ */
1720
+ interface WebhookPublic {
1721
+ id?: string;
1722
+ name?: string;
1723
+ url: string;
1724
+ secretToken: string;
1725
+ headers?: Record<string, string>;
1726
+ createdAt?: Date;
1727
+ createdBy?: string;
1728
+ lastUpdatedAt?: Date;
1729
+ lastUpdatedBy?: string;
1730
+ }
1731
+
1517
1732
  /**
1518
1733
  * This file was auto-generated by Fern from our API Definition.
1519
1734
  */
@@ -1556,13 +1771,6 @@ interface AnnotationQueueWrite {
1556
1771
  feedbackDefinitionNames?: string[];
1557
1772
  }
1558
1773
 
1559
- /**
1560
- * This file was auto-generated by Fern from our API Definition.
1561
- */
1562
- interface BatchDelete {
1563
- ids: string[];
1564
- }
1565
-
1566
1774
  /**
1567
1775
  * This file was auto-generated by Fern from our API Definition.
1568
1776
  */
@@ -1737,6 +1945,7 @@ interface LlmAsJudgeMessage {
1737
1945
  interface LlmAsJudgeModelParameters {
1738
1946
  name: string;
1739
1947
  temperature: number;
1948
+ seed?: number;
1740
1949
  }
1741
1950
 
1742
1951
  /**
@@ -1881,6 +2090,7 @@ interface LlmAsJudgeMessageWrite {
1881
2090
  interface LlmAsJudgeModelParametersWrite {
1882
2091
  name: string;
1883
2092
  temperature: number;
2093
+ seed?: number;
1884
2094
  }
1885
2095
 
1886
2096
  /**
@@ -2042,6 +2252,7 @@ interface LlmAsJudgeMessagePublic {
2042
2252
  interface LlmAsJudgeModelParametersPublic {
2043
2253
  name: string;
2044
2254
  temperature: number;
2255
+ seed?: number;
2045
2256
  }
2046
2257
 
2047
2258
  /**
@@ -3219,6 +3430,16 @@ declare const ExperimentPublicType: {
3219
3430
  readonly MiniBatch: "mini-batch";
3220
3431
  };
3221
3432
 
3433
+ /**
3434
+ * This file was auto-generated by Fern from our API Definition.
3435
+ */
3436
+ type ExperimentPublicStatus = "running" | "completed" | "cancelled";
3437
+ declare const ExperimentPublicStatus: {
3438
+ readonly Running: "running";
3439
+ readonly Completed: "completed";
3440
+ readonly Cancelled: "cancelled";
3441
+ };
3442
+
3222
3443
  /**
3223
3444
  * This file was auto-generated by Fern from our API Definition.
3224
3445
  */
@@ -3242,6 +3463,7 @@ interface ExperimentPublic {
3242
3463
  lastUpdatedAt?: Date;
3243
3464
  createdBy?: string;
3244
3465
  lastUpdatedBy?: string;
3466
+ status?: ExperimentPublicStatus;
3245
3467
  promptVersion?: PromptVersionLinkPublic;
3246
3468
  promptVersions?: PromptVersionLinkPublic[];
3247
3469
  }
@@ -3313,6 +3535,11 @@ interface GroupContentWithAggregations {
3313
3535
  aggregations?: AggregationData;
3314
3536
  }
3315
3537
 
3538
+ /**
3539
+ * This file was auto-generated by Fern from our API Definition.
3540
+ */
3541
+ type JsonNode = Record<string, unknown>;
3542
+
3316
3543
  /**
3317
3544
  * This file was auto-generated by Fern from our API Definition.
3318
3545
  */
@@ -3513,11 +3740,6 @@ interface NumericalFeedbackDetailUpdate {
3513
3740
  min: number;
3514
3741
  }
3515
3742
 
3516
- /**
3517
- * This file was auto-generated by Fern from our API Definition.
3518
- */
3519
- type JsonNode = Record<string, unknown>;
3520
-
3521
3743
  /**
3522
3744
  * This file was auto-generated by Fern from our API Definition.
3523
3745
  */
@@ -4786,6 +5008,95 @@ declare class SystemUsage {
4786
5008
  }>;
4787
5009
  }
4788
5010
 
5011
+ /**
5012
+ * This file was auto-generated by Fern from our API Definition.
5013
+ */
5014
+
5015
+ declare namespace Alerts {
5016
+ interface Options {
5017
+ environment?: Supplier<OpikApiEnvironment | string>;
5018
+ /** Specify a custom URL to connect the client to. */
5019
+ baseUrl?: Supplier<string>;
5020
+ /** Override the Authorization header */
5021
+ apiKey?: Supplier<string | undefined>;
5022
+ /** Override the Comet-Workspace header */
5023
+ workspaceName?: Supplier<string | undefined>;
5024
+ }
5025
+ interface RequestOptions {
5026
+ /** The maximum time to wait for a response in seconds. */
5027
+ timeoutInSeconds?: number;
5028
+ /** The number of times to retry the request. Defaults to 2. */
5029
+ maxRetries?: number;
5030
+ /** A hook to abort the request. */
5031
+ abortSignal?: AbortSignal;
5032
+ /** Override the Authorization header */
5033
+ apiKey?: string | undefined;
5034
+ /** Override the Comet-Workspace header */
5035
+ workspaceName?: string | undefined;
5036
+ /** Additional headers to include in the request. */
5037
+ headers?: Record<string, string>;
5038
+ }
5039
+ }
5040
+ /**
5041
+ * Alert resources
5042
+ */
5043
+ declare class Alerts {
5044
+ protected readonly _options: Alerts.Options;
5045
+ constructor(_options?: Alerts.Options);
5046
+ /**
5047
+ * Create alert
5048
+ *
5049
+ * @param {OpikApi.AlertWrite} request
5050
+ * @param {Alerts.RequestOptions} requestOptions - Request-specific configuration.
5051
+ *
5052
+ * @throws {@link OpikApi.BadRequestError}
5053
+ * @throws {@link OpikApi.ConflictError}
5054
+ * @throws {@link OpikApi.UnprocessableEntityError}
5055
+ *
5056
+ * @example
5057
+ * await client.alerts.createAlert({
5058
+ * name: "name",
5059
+ * webhook: {
5060
+ * url: "url",
5061
+ * secretToken: "secret_token"
5062
+ * }
5063
+ * })
5064
+ */
5065
+ createAlert(request: AlertWrite, requestOptions?: Alerts.RequestOptions): HttpResponsePromise<void>;
5066
+ private __createAlert;
5067
+ /**
5068
+ * Delete multiple alerts by their IDs
5069
+ *
5070
+ * @param {OpikApi.BatchDelete} request
5071
+ * @param {Alerts.RequestOptions} requestOptions - Request-specific configuration.
5072
+ *
5073
+ * @throws {@link OpikApi.BadRequestError}
5074
+ *
5075
+ * @example
5076
+ * await client.alerts.deleteAlertBatch({
5077
+ * ids: ["ids"]
5078
+ * })
5079
+ */
5080
+ deleteAlertBatch(request: BatchDelete, requestOptions?: Alerts.RequestOptions): HttpResponsePromise<void>;
5081
+ private __deleteAlertBatch;
5082
+ /**
5083
+ * Get Alert by id
5084
+ *
5085
+ * @param {string} id
5086
+ * @param {Alerts.RequestOptions} requestOptions - Request-specific configuration.
5087
+ *
5088
+ * @throws {@link OpikApi.NotFoundError}
5089
+ *
5090
+ * @example
5091
+ * await client.alerts.getAlertById("id")
5092
+ */
5093
+ getAlertById(id: string, requestOptions?: Alerts.RequestOptions): HttpResponsePromise<AlertPublic>;
5094
+ private __getAlertById;
5095
+ protected _getCustomAuthorizationHeaders(): Promise<{
5096
+ Authorization: string | undefined;
5097
+ }>;
5098
+ }
5099
+
4789
5100
  /**
4790
5101
  * This file was auto-generated by Fern from our API Definition.
4791
5102
  */
@@ -5755,6 +6066,21 @@ declare class Experiments {
5755
6066
  */
5756
6067
  getExperimentById(id: string, requestOptions?: Experiments.RequestOptions): HttpResponsePromise<ExperimentPublic>;
5757
6068
  private __getExperimentById;
6069
+ /**
6070
+ * Update experiment by id
6071
+ *
6072
+ * @param {string} id
6073
+ * @param {OpikApi.ExperimentUpdate} request
6074
+ * @param {Experiments.RequestOptions} requestOptions - Request-specific configuration.
6075
+ *
6076
+ * @throws {@link OpikApi.BadRequestError}
6077
+ * @throws {@link OpikApi.NotFoundError}
6078
+ *
6079
+ * @example
6080
+ * await client.experiments.updateExperiment("id")
6081
+ */
6082
+ updateExperiment(id: string, request?: ExperimentUpdate, requestOptions?: Experiments.RequestOptions): HttpResponsePromise<void>;
6083
+ private __updateExperiment;
5758
6084
  /**
5759
6085
  * Get experiment item by id
5760
6086
  *
@@ -7653,6 +7979,7 @@ declare namespace OpikApiClient {
7653
7979
  declare class OpikApiClient {
7654
7980
  protected readonly _options: OpikApiClient.Options;
7655
7981
  protected _systemUsage: SystemUsage | undefined;
7982
+ protected _alerts: Alerts | undefined;
7656
7983
  protected _annotationQueues: AnnotationQueues | undefined;
7657
7984
  protected _attachments: Attachments | undefined;
7658
7985
  protected _check: Check | undefined;
@@ -7674,6 +8001,7 @@ declare class OpikApiClient {
7674
8001
  protected _redirect: Redirect | undefined;
7675
8002
  constructor(_options?: OpikApiClient.Options);
7676
8003
  get systemUsage(): SystemUsage;
8004
+ get alerts(): Alerts;
7677
8005
  get annotationQueues(): AnnotationQueues;
7678
8006
  get attachments(): Attachments;
7679
8007
  get check(): Check;