opik 2.2.154 → 2.3.0

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/index.d.cts CHANGED
@@ -1034,6 +1034,31 @@ interface DatasetExpansionWrite {
1034
1034
  maxCompletionTokens?: number;
1035
1035
  }
1036
1036
 
1037
+ /**
1038
+ * @example
1039
+ * {}
1040
+ */
1041
+ interface DatasetExperimentItemStreamRequest {
1042
+ /** Dataset ID. Set this or dataset_name */
1043
+ datasetId?: string;
1044
+ /** Dataset name. Set this or dataset_id */
1045
+ datasetName?: string;
1046
+ /** Project of the dataset, used with dataset_name */
1047
+ projectName?: string;
1048
+ /** Dataset version hashes or tags, such as 'latest'. Only experiments run against one of these versions are included; omit for every version. Returns 404 if any version does not exist */
1049
+ datasetVersions?: string[];
1050
+ /** JSON array of dataset item filters, evaluated against the newest version of each item that the experiments reference */
1051
+ filters?: string;
1052
+ /** Maximum number of experiment items to return */
1053
+ limit?: number;
1054
+ /** Optional hint: experiment_id of the last experiment item received. Used only if that item was deleted, to resume from the start of its experiment instead of from the start of the stream. Requires last_retrieved_id */
1055
+ lastRetrievedExperimentId?: string;
1056
+ /** id of the last experiment item received */
1057
+ lastRetrievedId?: string;
1058
+ /** Truncate image included in either input, output or metadata */
1059
+ truncate?: boolean;
1060
+ }
1061
+
1037
1062
  /**
1038
1063
  * @example
1039
1064
  * {
@@ -1227,7 +1252,7 @@ interface FindDatasetItemsWithExperimentItemsRequest {
1227
1252
  page?: number;
1228
1253
  size?: number;
1229
1254
  experimentIds?: string;
1230
- datasetVersion?: string;
1255
+ datasetVersions?: string;
1231
1256
  filters?: string;
1232
1257
  sorting?: string;
1233
1258
  search?: string;
@@ -3587,6 +3612,162 @@ declare const TraceSearchStreamRequestPublicExcludeItem: {
3587
3612
  };
3588
3613
  type TraceSearchStreamRequestPublicExcludeItem = (typeof TraceSearchStreamRequestPublicExcludeItem)[keyof typeof TraceSearchStreamRequestPublicExcludeItem];
3589
3614
 
3615
+ /**
3616
+ * @example
3617
+ * {}
3618
+ */
3619
+ type DeleteViewRequest = {};
3620
+
3621
+ /**
3622
+ * @example
3623
+ * {}
3624
+ */
3625
+ type DeleteViewVersionRequest = {};
3626
+
3627
+ /**
3628
+ * @example
3629
+ * {}
3630
+ */
3631
+ type GetViewByIdRequest = {};
3632
+
3633
+ /**
3634
+ * @example
3635
+ * {}
3636
+ */
3637
+ type GetViewVersionRequest = {};
3638
+
3639
+ /**
3640
+ * @example
3641
+ * {}
3642
+ */
3643
+ interface GetViewVersionsRequest {
3644
+ page?: number;
3645
+ size?: number;
3646
+ }
3647
+
3648
+ /**
3649
+ * @example
3650
+ * {
3651
+ * area: "widget",
3652
+ * name: "name",
3653
+ * type: "html",
3654
+ * engineVersion: 1,
3655
+ * inputs: {
3656
+ * "key": {
3657
+ * kind: "query",
3658
+ * queryId: "query_id"
3659
+ * }
3660
+ * },
3661
+ * html: "html"
3662
+ * }
3663
+ */
3664
+ interface ViewCreate {
3665
+ /** The content area the view is written for; fixed after creation */
3666
+ area: ViewCreateArea;
3667
+ name: string;
3668
+ description?: string;
3669
+ /** What the first version shows, one line */
3670
+ summary?: string;
3671
+ /** Who produced the version: user (default), ollie or agent. Informational only */
3672
+ author?: ViewCreateAuthor;
3673
+ /** View type */
3674
+ type: ViewCreateType;
3675
+ /** HTML contract version the view was written against */
3676
+ engineVersion: number;
3677
+ /** Libraries the host loads before the view runs; none when omitted */
3678
+ libraries?: string[];
3679
+ /** Input name to data source, one or several; the view receives one data object with a key per input */
3680
+ inputs: Record<string, ViewInput>;
3681
+ /** The view: HTML, CSS and script rendered in a sandboxed iframe */
3682
+ html: string;
3683
+ }
3684
+
3685
+ /**
3686
+ * @example
3687
+ * {
3688
+ * version: 1
3689
+ * }
3690
+ */
3691
+ interface ViewCurrentVersion {
3692
+ /** An existing version number of the view, starting at 1 */
3693
+ version: number;
3694
+ }
3695
+
3696
+ /**
3697
+ * @example
3698
+ * {}
3699
+ */
3700
+ interface ViewUpdate {
3701
+ name?: string;
3702
+ /** Omit to keep the description; an empty or blank string clears it */
3703
+ description?: string;
3704
+ }
3705
+
3706
+ /**
3707
+ * @example
3708
+ * {
3709
+ * type: "html",
3710
+ * engineVersion: 1,
3711
+ * inputs: {
3712
+ * "key": {
3713
+ * kind: "query",
3714
+ * queryId: "query_id"
3715
+ * }
3716
+ * },
3717
+ * html: "html"
3718
+ * }
3719
+ */
3720
+ interface ViewVersionCreate {
3721
+ /** What changed, one line */
3722
+ summary?: string;
3723
+ /** Who produced the version: user (default), ollie or agent. Informational only */
3724
+ author?: ViewVersionCreateAuthor;
3725
+ /** View type */
3726
+ type: ViewVersionCreateType;
3727
+ /** HTML contract version the view was written against */
3728
+ engineVersion: number;
3729
+ /** Libraries the host loads before the view runs; none when omitted */
3730
+ libraries?: string[];
3731
+ /** Input name to data source, one or several; the view receives one data object with a key per input */
3732
+ inputs: Record<string, ViewInput>;
3733
+ /** The view: HTML, CSS and script rendered in a sandboxed iframe */
3734
+ html: string;
3735
+ }
3736
+
3737
+ /** The content area the view is written for; fixed after creation */
3738
+ declare const ViewCreateArea: {
3739
+ readonly Widget: "widget";
3740
+ };
3741
+ type ViewCreateArea = (typeof ViewCreateArea)[keyof typeof ViewCreateArea];
3742
+
3743
+ /** Who produced the version: user (default), ollie or agent. Informational only */
3744
+ declare const ViewCreateAuthor: {
3745
+ readonly User: "user";
3746
+ readonly Ollie: "ollie";
3747
+ readonly Agent: "agent";
3748
+ };
3749
+ type ViewCreateAuthor = (typeof ViewCreateAuthor)[keyof typeof ViewCreateAuthor];
3750
+
3751
+ /** View type */
3752
+ declare const ViewCreateType: {
3753
+ readonly Html: "html";
3754
+ };
3755
+ type ViewCreateType = (typeof ViewCreateType)[keyof typeof ViewCreateType];
3756
+
3757
+ /** Who produced the version: user (default), ollie or agent. Informational only */
3758
+ declare const ViewVersionCreateAuthor: {
3759
+ readonly User: "user";
3760
+ readonly Ollie: "ollie";
3761
+ readonly Agent: "agent";
3762
+ };
3763
+ type ViewVersionCreateAuthor = (typeof ViewVersionCreateAuthor)[keyof typeof ViewVersionCreateAuthor];
3764
+
3765
+ /** View type */
3766
+ declare const ViewVersionCreateType: {
3767
+ readonly Html: "html";
3768
+ };
3769
+ type ViewVersionCreateType = (typeof ViewVersionCreateType)[keyof typeof ViewVersionCreateType];
3770
+
3590
3771
  /**
3591
3772
  * @example
3592
3773
  * {}
@@ -6535,8 +6716,8 @@ interface LlmAsJudgeMessage {
6535
6716
  role: LlmAsJudgeMessageRole;
6536
6717
  content?: string;
6537
6718
  contentArray?: LlmAsJudgeMessageContent[];
6538
- structuredContent?: boolean;
6539
6719
  stringContent?: boolean;
6720
+ structuredContent?: boolean;
6540
6721
  }
6541
6722
 
6542
6723
  interface LlmAsJudgeMessageContent {
@@ -6567,8 +6748,8 @@ interface LlmAsJudgeMessagePublic {
6567
6748
  role: LlmAsJudgeMessagePublicRole;
6568
6749
  content?: string;
6569
6750
  contentArray?: LlmAsJudgeMessageContentPublic[];
6570
- structuredContent?: boolean;
6571
6751
  stringContent?: boolean;
6752
+ structuredContent?: boolean;
6572
6753
  }
6573
6754
 
6574
6755
  declare const LlmAsJudgeMessagePublicRole: {
@@ -6593,8 +6774,8 @@ interface LlmAsJudgeMessageWrite {
6593
6774
  role: LlmAsJudgeMessageWriteRole;
6594
6775
  content?: string;
6595
6776
  contentArray?: LlmAsJudgeMessageContentWrite[];
6596
- structuredContent?: boolean;
6597
6777
  stringContent?: boolean;
6778
+ structuredContent?: boolean;
6598
6779
  }
6599
6780
 
6600
6781
  declare const LlmAsJudgeMessageWriteRole: {
@@ -7785,6 +7966,7 @@ interface ServiceTogglesConfig {
7785
7966
  welcomeWizardEnabled: boolean;
7786
7967
  exportEnabled: boolean;
7787
7968
  costIntelligenceEnabled: boolean;
7969
+ modelPricesEnabled: boolean;
7788
7970
  datasetVersioningEnabled: boolean;
7789
7971
  datasetExportEnabled: boolean;
7790
7972
  demoDataEnabled: boolean;
@@ -8912,6 +9094,106 @@ interface VideoUrlWrite {
8912
9094
  url: string;
8913
9095
  }
8914
9096
 
9097
+ /**
9098
+ * A generated view and the version that renders
9099
+ */
9100
+ interface View {
9101
+ id?: string;
9102
+ area?: ViewArea;
9103
+ name?: string;
9104
+ description?: string;
9105
+ currentVersion?: number;
9106
+ createdAt?: Date;
9107
+ createdBy?: string;
9108
+ lastUpdatedAt?: Date;
9109
+ lastUpdatedBy?: string;
9110
+ version?: ViewVersion;
9111
+ }
9112
+
9113
+ declare const ViewArea: {
9114
+ readonly Widget: "widget";
9115
+ };
9116
+ type ViewArea = (typeof ViewArea)[keyof typeof ViewArea];
9117
+
9118
+ /**
9119
+ * A data source of a view; the host resolves it and passes the result under the input name
9120
+ */
9121
+ interface ViewInput {
9122
+ /** Source type */
9123
+ kind: ViewInputKind;
9124
+ /** The saved query to run */
9125
+ queryId: string;
9126
+ /** The columns the author saw when it ran the query, name to type. Informational */
9127
+ columns?: Record<string, string>;
9128
+ }
9129
+
9130
+ /** Source type */
9131
+ declare const ViewInputKind: {
9132
+ readonly Query: "query";
9133
+ };
9134
+ type ViewInputKind = (typeof ViewInputKind)[keyof typeof ViewInputKind];
9135
+
9136
+ /**
9137
+ * An immutable version of a view
9138
+ */
9139
+ interface ViewVersion {
9140
+ viewId?: string;
9141
+ version?: number;
9142
+ author?: ViewVersionAuthor;
9143
+ summary?: string;
9144
+ type?: ViewVersionType;
9145
+ /** HTML contract version the view was written against */
9146
+ engineVersion?: number;
9147
+ inputs?: Record<string, ViewInput>;
9148
+ /** Libraries the host loads before the view runs; omitted when it uses none */
9149
+ libraries?: string[];
9150
+ html?: string;
9151
+ createdAt?: Date;
9152
+ createdBy?: string;
9153
+ }
9154
+
9155
+ declare const ViewVersionAuthor: {
9156
+ readonly User: "user";
9157
+ readonly Ollie: "ollie";
9158
+ readonly Agent: "agent";
9159
+ };
9160
+ type ViewVersionAuthor = (typeof ViewVersionAuthor)[keyof typeof ViewVersionAuthor];
9161
+
9162
+ /**
9163
+ * A page of a view's versions, newest first
9164
+ */
9165
+ interface ViewVersionPage {
9166
+ content?: ViewVersionSummary[];
9167
+ page?: number;
9168
+ /** Number of versions in this page */
9169
+ size?: number;
9170
+ total?: number;
9171
+ }
9172
+
9173
+ /**
9174
+ * A version of a view without its HTML
9175
+ */
9176
+ interface ViewVersionSummary {
9177
+ version?: number;
9178
+ author?: ViewVersionSummaryAuthor;
9179
+ /** Change summary; omitted when the author gave none */
9180
+ summary?: string;
9181
+ createdAt?: Date;
9182
+ createdBy?: string;
9183
+ }
9184
+
9185
+ declare const ViewVersionSummaryAuthor: {
9186
+ readonly User: "user";
9187
+ readonly Ollie: "ollie";
9188
+ readonly Agent: "agent";
9189
+ };
9190
+ type ViewVersionSummaryAuthor = (typeof ViewVersionSummaryAuthor)[keyof typeof ViewVersionSummaryAuthor];
9191
+
9192
+ declare const ViewVersionType: {
9193
+ readonly Html: "html";
9194
+ };
9195
+ type ViewVersionType = (typeof ViewVersionType)[keyof typeof ViewVersionType];
9196
+
8915
9197
  interface WebhookExamples {
8916
9198
  responseExamples?: Record<string, Record<string, unknown>>;
8917
9199
  }
@@ -10724,6 +11006,18 @@ declare class DatasetsClient {
10724
11006
  */
10725
11007
  startDatasetExport(id: string, request?: StartDatasetExportRequest, requestOptions?: DatasetsClient.RequestOptions): HttpResponsePromise<DatasetExportJobPublic>;
10726
11008
  private __startDatasetExport;
11009
+ /**
11010
+ * Stream the experiment items of every regular experiment on a dataset, one experiment item per line.
11011
+ * Optimizer trial, mini-batch and mutation experiments are excluded.
11012
+ *
11013
+ * Rows are ordered by experiment, then dataset item. To read the next page, send the id of the last row
11014
+ * received as last_retrieved_id; a page with fewer rows than the limit is the last one. Optionally also
11015
+ * send its experiment_id as last_retrieved_experiment_id: it is only used if that row was deleted, to
11016
+ * resume from the start of its experiment instead of from the start of the stream.
11017
+ * @throws {@link OpikApi.NotFoundError}
11018
+ */
11019
+ streamDatasetExperimentItems(request?: DatasetExperimentItemStreamRequest, requestOptions?: DatasetsClient.RequestOptions): HttpResponsePromise<ReadableStream<Uint8Array>>;
11020
+ private __streamDatasetExperimentItems;
10727
11021
  /**
10728
11022
  * Stream dataset items
10729
11023
  */
@@ -14260,6 +14554,172 @@ declare class TracesClient {
14260
14554
  private __updateTraceComment;
14261
14555
  }
14262
14556
 
14557
+ declare namespace ViewsClient {
14558
+ type Options = BaseClientOptions;
14559
+ interface RequestOptions extends BaseRequestOptions {
14560
+ }
14561
+ }
14562
+ /**
14563
+ * Generated view resources
14564
+ */
14565
+ declare class ViewsClient {
14566
+ protected readonly _options: NormalizedClientOptions<ViewsClient.Options>;
14567
+ constructor(options?: ViewsClient.Options);
14568
+ /**
14569
+ * Create a view with its first version
14570
+ *
14571
+ * @param {OpikApi.ViewCreate} request
14572
+ * @param {ViewsClient.RequestOptions} requestOptions - Request-specific configuration.
14573
+ *
14574
+ * @throws {@link OpikApi.UnprocessableEntityError}
14575
+ *
14576
+ * @example
14577
+ * await client.views.createView({
14578
+ * area: "widget",
14579
+ * name: "name",
14580
+ * type: "html",
14581
+ * engineVersion: 1,
14582
+ * inputs: {
14583
+ * "key": {
14584
+ * kind: "query",
14585
+ * queryId: "query_id"
14586
+ * }
14587
+ * },
14588
+ * html: "html"
14589
+ * })
14590
+ */
14591
+ createView(request: ViewCreate, requestOptions?: ViewsClient.RequestOptions): HttpResponsePromise<View>;
14592
+ private __createView;
14593
+ /**
14594
+ * List the versions of a view, newest first
14595
+ *
14596
+ * @param {string} id
14597
+ * @param {OpikApi.GetViewVersionsRequest} request
14598
+ * @param {ViewsClient.RequestOptions} requestOptions - Request-specific configuration.
14599
+ *
14600
+ * @throws {@link OpikApi.NotFoundError}
14601
+ *
14602
+ * @example
14603
+ * await client.views.getViewVersions("id")
14604
+ */
14605
+ getViewVersions(id: string, request?: GetViewVersionsRequest, requestOptions?: ViewsClient.RequestOptions): HttpResponsePromise<ViewVersionPage>;
14606
+ private __getViewVersions;
14607
+ /**
14608
+ * Add a version to a view and make it current
14609
+ *
14610
+ * @param {string} id
14611
+ * @param {OpikApi.ViewVersionCreate} request
14612
+ * @param {ViewsClient.RequestOptions} requestOptions - Request-specific configuration.
14613
+ *
14614
+ * @throws {@link OpikApi.NotFoundError}
14615
+ * @throws {@link OpikApi.UnprocessableEntityError}
14616
+ *
14617
+ * @example
14618
+ * await client.views.createViewVersion("id", {
14619
+ * type: "html",
14620
+ * engineVersion: 1,
14621
+ * inputs: {
14622
+ * "key": {
14623
+ * kind: "query",
14624
+ * queryId: "query_id"
14625
+ * }
14626
+ * },
14627
+ * html: "html"
14628
+ * })
14629
+ */
14630
+ createViewVersion(id: string, request: ViewVersionCreate, requestOptions?: ViewsClient.RequestOptions): HttpResponsePromise<ViewVersion>;
14631
+ private __createViewVersion;
14632
+ /**
14633
+ * Get a view with its current version
14634
+ *
14635
+ * @param {string} id
14636
+ * @param {OpikApi.GetViewByIdRequest} request
14637
+ * @param {ViewsClient.RequestOptions} requestOptions - Request-specific configuration.
14638
+ *
14639
+ * @throws {@link OpikApi.NotFoundError}
14640
+ *
14641
+ * @example
14642
+ * await client.views.getViewById("id")
14643
+ */
14644
+ getViewById(id: string, request?: GetViewByIdRequest, requestOptions?: ViewsClient.RequestOptions): HttpResponsePromise<View>;
14645
+ private __getViewById;
14646
+ /**
14647
+ * Soft delete a view.
14648
+ *
14649
+ * @param {string} id
14650
+ * @param {OpikApi.DeleteViewRequest} request
14651
+ * @param {ViewsClient.RequestOptions} requestOptions - Request-specific configuration.
14652
+ *
14653
+ * @throws {@link OpikApi.NotFoundError}
14654
+ *
14655
+ * @example
14656
+ * await client.views.deleteView("id")
14657
+ */
14658
+ deleteView(id: string, request?: DeleteViewRequest, requestOptions?: ViewsClient.RequestOptions): HttpResponsePromise<void>;
14659
+ private __deleteView;
14660
+ /**
14661
+ * Update the name and description of a view
14662
+ *
14663
+ * @param {string} id
14664
+ * @param {OpikApi.ViewUpdate} request
14665
+ * @param {ViewsClient.RequestOptions} requestOptions - Request-specific configuration.
14666
+ *
14667
+ * @throws {@link OpikApi.NotFoundError}
14668
+ *
14669
+ * @example
14670
+ * await client.views.updateView("id")
14671
+ */
14672
+ updateView(id: string, request?: ViewUpdate, requestOptions?: ViewsClient.RequestOptions): HttpResponsePromise<View>;
14673
+ private __updateView;
14674
+ /**
14675
+ * Get one version of a view
14676
+ *
14677
+ * @param {string} id
14678
+ * @param {number} version
14679
+ * @param {OpikApi.GetViewVersionRequest} request
14680
+ * @param {ViewsClient.RequestOptions} requestOptions - Request-specific configuration.
14681
+ *
14682
+ * @throws {@link OpikApi.NotFoundError}
14683
+ *
14684
+ * @example
14685
+ * await client.views.getViewVersion("id", 1)
14686
+ */
14687
+ getViewVersion(id: string, version: number, request?: GetViewVersionRequest, requestOptions?: ViewsClient.RequestOptions): HttpResponsePromise<ViewVersion>;
14688
+ private __getViewVersion;
14689
+ /**
14690
+ * Delete one version of a view. Refused for the current version, and so for the only version; version numbers are never reused.
14691
+ *
14692
+ * @param {string} id
14693
+ * @param {number} version
14694
+ * @param {OpikApi.DeleteViewVersionRequest} request
14695
+ * @param {ViewsClient.RequestOptions} requestOptions - Request-specific configuration.
14696
+ *
14697
+ * @throws {@link OpikApi.NotFoundError}
14698
+ * @throws {@link OpikApi.ConflictError}
14699
+ *
14700
+ * @example
14701
+ * await client.views.deleteViewVersion("id", 1)
14702
+ */
14703
+ deleteViewVersion(id: string, version: number, request?: DeleteViewVersionRequest, requestOptions?: ViewsClient.RequestOptions): HttpResponsePromise<void>;
14704
+ private __deleteViewVersion;
14705
+ /**
14706
+ * Make an existing version the one that renders. Also used for rollback; writes no version.
14707
+ *
14708
+ * @param {string} id
14709
+ * @param {OpikApi.ViewCurrentVersion} request
14710
+ * @param {ViewsClient.RequestOptions} requestOptions - Request-specific configuration.
14711
+ *
14712
+ * @throws {@link OpikApi.NotFoundError}
14713
+ *
14714
+ * @example
14715
+ * await client.views.setViewCurrentVersion("id", {
14716
+ * version: 1
14717
+ * })
14718
+ */
14719
+ setViewCurrentVersion(id: string, request: ViewCurrentVersion, requestOptions?: ViewsClient.RequestOptions): HttpResponsePromise<View>;
14720
+ private __setViewCurrentVersion;
14721
+ }
14722
+
14263
14723
  declare namespace WelcomeWizardClient {
14264
14724
  type Options = BaseClientOptions;
14265
14725
  interface RequestOptions extends BaseRequestOptions {
@@ -14510,6 +14970,7 @@ declare class OpikApiClient {
14510
14970
  protected _serviceToggles: ServiceTogglesClient | undefined;
14511
14971
  protected _spans: SpansClient | undefined;
14512
14972
  protected _traces: TracesClient | undefined;
14973
+ protected _views: ViewsClient | undefined;
14513
14974
  protected _welcomeWizard: WelcomeWizardClient | undefined;
14514
14975
  protected _workspacePermissions: WorkspacePermissionsClient | undefined;
14515
14976
  protected _workspaces: WorkspacesClient | undefined;
@@ -14555,6 +15016,7 @@ declare class OpikApiClient {
14555
15016
  get serviceToggles(): ServiceTogglesClient;
14556
15017
  get spans(): SpansClient;
14557
15018
  get traces(): TracesClient;
15019
+ get views(): ViewsClient;
14558
15020
  get welcomeWizard(): WelcomeWizardClient;
14559
15021
  get workspacePermissions(): WorkspacePermissionsClient;
14560
15022
  get workspaces(): WorkspacesClient;