opik 0.0.7 → 0.1.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.
@@ -0,0 +1,4747 @@
1
+ import * as stream from 'stream';
2
+
3
+ interface OpikConfig {
4
+ apiKey: string;
5
+ host?: string;
6
+ projectName: string;
7
+ workspaceName: string;
8
+ }
9
+
10
+ /**
11
+ * This file was auto-generated by Fern from our API Definition.
12
+ */
13
+ type FindFeedbackDefinitionsRequestType = "numerical" | "categorical";
14
+ declare const FindFeedbackDefinitionsRequestType: {
15
+ readonly Numerical: "numerical";
16
+ readonly Categorical: "categorical";
17
+ };
18
+
19
+ /**
20
+ * This file was auto-generated by Fern from our API Definition.
21
+ */
22
+
23
+ /**
24
+ * @example
25
+ * {}
26
+ */
27
+ interface FindFeedbackDefinitionsRequest {
28
+ page?: number;
29
+ size?: number;
30
+ name?: string;
31
+ type?: FindFeedbackDefinitionsRequestType;
32
+ }
33
+
34
+ /**
35
+ * This file was auto-generated by Fern from our API Definition.
36
+ */
37
+ type ProviderApiKeyWriteProvider = "openai" | "anthropic" | "gemini";
38
+ declare const ProviderApiKeyWriteProvider: {
39
+ readonly Openai: "openai";
40
+ readonly Anthropic: "anthropic";
41
+ readonly Gemini: "gemini";
42
+ };
43
+
44
+ /**
45
+ * This file was auto-generated by Fern from our API Definition.
46
+ */
47
+
48
+ /**
49
+ * @example
50
+ * {
51
+ * provider: "openai",
52
+ * apiKey: "api_key"
53
+ * }
54
+ */
55
+ interface ProviderApiKeyWrite {
56
+ provider: ProviderApiKeyWriteProvider;
57
+ apiKey: string;
58
+ name?: string;
59
+ }
60
+
61
+ /**
62
+ * This file was auto-generated by Fern from our API Definition.
63
+ */
64
+ /**
65
+ * @example
66
+ * {
67
+ * apiKey: "api_key"
68
+ * }
69
+ */
70
+ interface ProviderApiKeyUpdate {
71
+ apiKey: string;
72
+ name?: string;
73
+ }
74
+
75
+ /**
76
+ * This file was auto-generated by Fern from our API Definition.
77
+ */
78
+ type ProjectMetricRequestPublicMetricType = "FEEDBACK_SCORES" | "TRACE_COUNT" | "TOKEN_USAGE" | "DURATION" | "COST";
79
+ declare const ProjectMetricRequestPublicMetricType: {
80
+ readonly FeedbackScores: "FEEDBACK_SCORES";
81
+ readonly TraceCount: "TRACE_COUNT";
82
+ readonly TokenUsage: "TOKEN_USAGE";
83
+ readonly Duration: "DURATION";
84
+ readonly Cost: "COST";
85
+ };
86
+
87
+ /**
88
+ * This file was auto-generated by Fern from our API Definition.
89
+ */
90
+ type ProjectMetricRequestPublicInterval = "HOURLY" | "DAILY" | "WEEKLY";
91
+ declare const ProjectMetricRequestPublicInterval: {
92
+ readonly Hourly: "HOURLY";
93
+ readonly Daily: "DAILY";
94
+ readonly Weekly: "WEEKLY";
95
+ };
96
+
97
+ /**
98
+ * This file was auto-generated by Fern from our API Definition.
99
+ */
100
+ /**
101
+ * @example
102
+ * {}
103
+ */
104
+ interface FindProjectsRequest {
105
+ page?: number;
106
+ size?: number;
107
+ name?: string;
108
+ sorting?: string;
109
+ }
110
+
111
+ /**
112
+ * This file was auto-generated by Fern from our API Definition.
113
+ */
114
+ /**
115
+ * @example
116
+ * {
117
+ * name: "name"
118
+ * }
119
+ */
120
+ interface ProjectWrite {
121
+ name: string;
122
+ description?: string;
123
+ }
124
+
125
+ /**
126
+ * This file was auto-generated by Fern from our API Definition.
127
+ */
128
+ /**
129
+ * @example
130
+ * {}
131
+ */
132
+ interface ProjectUpdate {
133
+ name?: string;
134
+ description?: string;
135
+ }
136
+
137
+ /**
138
+ * This file was auto-generated by Fern from our API Definition.
139
+ */
140
+ /**
141
+ * @example
142
+ * {}
143
+ */
144
+ interface FindFeedbackScoreNamesByProjectIdsRequest {
145
+ projectIds?: string;
146
+ }
147
+
148
+ /**
149
+ * This file was auto-generated by Fern from our API Definition.
150
+ */
151
+
152
+ /**
153
+ * @example
154
+ * {}
155
+ */
156
+ interface ProjectMetricRequestPublic {
157
+ metricType?: ProjectMetricRequestPublicMetricType;
158
+ interval?: ProjectMetricRequestPublicInterval;
159
+ intervalStart?: Date;
160
+ intervalEnd?: Date;
161
+ }
162
+
163
+ /**
164
+ * This file was auto-generated by Fern from our API Definition.
165
+ */
166
+ /**
167
+ * @example
168
+ * {}
169
+ */
170
+ interface GetProjectStatsRequest {
171
+ page?: number;
172
+ size?: number;
173
+ name?: string;
174
+ sorting?: string;
175
+ }
176
+
177
+ /**
178
+ * This file was auto-generated by Fern from our API Definition.
179
+ */
180
+ /**
181
+ * @example
182
+ * {
183
+ * name: "name"
184
+ * }
185
+ */
186
+ interface ProjectRetrieveDetailed {
187
+ name: string;
188
+ }
189
+
190
+ /**
191
+ * This file was auto-generated by Fern from our API Definition.
192
+ */
193
+ type PromptWriteType = "mustache" | "jinja2";
194
+ declare const PromptWriteType: {
195
+ readonly Mustache: "mustache";
196
+ readonly Jinja2: "jinja2";
197
+ };
198
+
199
+ /**
200
+ * This file was auto-generated by Fern from our API Definition.
201
+ */
202
+ /**
203
+ * @example
204
+ * {}
205
+ */
206
+ interface GetPromptsRequest {
207
+ page?: number;
208
+ size?: number;
209
+ name?: string;
210
+ }
211
+
212
+ /**
213
+ * This file was auto-generated by Fern from our API Definition.
214
+ */
215
+
216
+ /**
217
+ * @example
218
+ * {
219
+ * name: "name"
220
+ * }
221
+ */
222
+ interface PromptWrite {
223
+ id?: string;
224
+ name: string;
225
+ description?: string;
226
+ template?: string;
227
+ metadata?: JsonNodeWrite;
228
+ changeDescription?: string;
229
+ type?: PromptWriteType;
230
+ }
231
+
232
+ /**
233
+ * This file was auto-generated by Fern from our API Definition.
234
+ */
235
+
236
+ /**
237
+ * @example
238
+ * {
239
+ * name: "name",
240
+ * version: {
241
+ * template: "template"
242
+ * }
243
+ * }
244
+ */
245
+ interface CreatePromptVersionDetail {
246
+ name: string;
247
+ version: PromptVersionDetail;
248
+ }
249
+
250
+ /**
251
+ * This file was auto-generated by Fern from our API Definition.
252
+ */
253
+ /**
254
+ * @example
255
+ * {
256
+ * name: "name"
257
+ * }
258
+ */
259
+ interface PromptUpdatable {
260
+ name: string;
261
+ description?: string;
262
+ }
263
+
264
+ /**
265
+ * This file was auto-generated by Fern from our API Definition.
266
+ */
267
+ /**
268
+ * @example
269
+ * {}
270
+ */
271
+ interface GetPromptVersionsRequest {
272
+ page?: number;
273
+ size?: number;
274
+ }
275
+
276
+ /**
277
+ * This file was auto-generated by Fern from our API Definition.
278
+ */
279
+ /**
280
+ * @example
281
+ * {
282
+ * name: "name"
283
+ * }
284
+ */
285
+ interface PromptVersionRetrieveDetail {
286
+ name: string;
287
+ commit?: string;
288
+ }
289
+
290
+ /**
291
+ * This file was auto-generated by Fern from our API Definition.
292
+ */
293
+ type GetSpansByProjectRequestType = "general" | "tool" | "llm";
294
+ declare const GetSpansByProjectRequestType: {
295
+ readonly General: "general";
296
+ readonly Tool: "tool";
297
+ readonly Llm: "llm";
298
+ };
299
+
300
+ /**
301
+ * This file was auto-generated by Fern from our API Definition.
302
+ */
303
+ type FindFeedbackScoreNames1RequestType = "general" | "tool" | "llm";
304
+ declare const FindFeedbackScoreNames1RequestType: {
305
+ readonly General: "general";
306
+ readonly Tool: "tool";
307
+ readonly Llm: "llm";
308
+ };
309
+
310
+ /**
311
+ * This file was auto-generated by Fern from our API Definition.
312
+ */
313
+ type GetSpanStatsRequestType = "general" | "tool" | "llm";
314
+ declare const GetSpanStatsRequestType: {
315
+ readonly General: "general";
316
+ readonly Tool: "tool";
317
+ readonly Llm: "llm";
318
+ };
319
+
320
+ /**
321
+ * This file was auto-generated by Fern from our API Definition.
322
+ */
323
+ type SpanSearchStreamRequestPublicType = "general" | "tool" | "llm";
324
+ declare const SpanSearchStreamRequestPublicType: {
325
+ readonly General: "general";
326
+ readonly Tool: "tool";
327
+ readonly Llm: "llm";
328
+ };
329
+
330
+ /**
331
+ * This file was auto-generated by Fern from our API Definition.
332
+ */
333
+
334
+ /**
335
+ * @example
336
+ * {}
337
+ */
338
+ interface GetSpansByProjectRequest {
339
+ page?: number;
340
+ size?: number;
341
+ projectName?: string;
342
+ projectId?: string;
343
+ traceId?: string;
344
+ type?: GetSpansByProjectRequestType;
345
+ filters?: string;
346
+ truncate?: boolean;
347
+ }
348
+
349
+ /**
350
+ * This file was auto-generated by Fern from our API Definition.
351
+ */
352
+
353
+ /**
354
+ * @example
355
+ * {
356
+ * spans: [{
357
+ * traceId: "trace_id",
358
+ * name: "name",
359
+ * type: "general",
360
+ * startTime: "2024-01-15T09:30:00Z"
361
+ * }]
362
+ * }
363
+ */
364
+ interface SpanBatchWrite {
365
+ spans: SpanWrite[];
366
+ }
367
+
368
+ /**
369
+ * This file was auto-generated by Fern from our API Definition.
370
+ */
371
+
372
+ /**
373
+ * @example
374
+ * {
375
+ * traceId: "trace_id"
376
+ * }
377
+ */
378
+ interface SpanUpdate$1 {
379
+ /** If null and project_id not specified, Default Project is assumed */
380
+ projectName?: string;
381
+ /** If null and project_name not specified, Default Project is assumed */
382
+ projectId?: string;
383
+ traceId: string;
384
+ parentSpanId?: string;
385
+ endTime?: Date;
386
+ input?: JsonNode;
387
+ output?: JsonNode;
388
+ metadata?: JsonNode;
389
+ model?: string;
390
+ provider?: string;
391
+ tags?: string[];
392
+ usage?: Record<string, number>;
393
+ totalEstimatedCost?: number;
394
+ errorInfo?: ErrorInfo;
395
+ }
396
+
397
+ /**
398
+ * This file was auto-generated by Fern from our API Definition.
399
+ */
400
+
401
+ /**
402
+ * @example
403
+ * {}
404
+ */
405
+ interface FindFeedbackScoreNames1Request {
406
+ projectId?: string;
407
+ type?: FindFeedbackScoreNames1RequestType;
408
+ }
409
+
410
+ /**
411
+ * This file was auto-generated by Fern from our API Definition.
412
+ */
413
+
414
+ /**
415
+ * @example
416
+ * {}
417
+ */
418
+ interface GetSpanStatsRequest {
419
+ projectId?: string;
420
+ projectName?: string;
421
+ traceId?: string;
422
+ type?: GetSpanStatsRequestType;
423
+ filters?: string;
424
+ }
425
+
426
+ /**
427
+ * This file was auto-generated by Fern from our API Definition.
428
+ */
429
+
430
+ interface SpanSearchStreamRequestPublic {
431
+ traceId?: string;
432
+ projectName?: string;
433
+ projectId?: string;
434
+ type?: SpanSearchStreamRequestPublicType;
435
+ filters?: SpanFilterPublic[];
436
+ limit?: number;
437
+ lastRetrievedId?: string;
438
+ /** Truncate image included in either input, output or metadata */
439
+ truncate?: boolean;
440
+ }
441
+
442
+ /**
443
+ * This file was auto-generated by Fern from our API Definition.
444
+ */
445
+ /**
446
+ * @example
447
+ * {}
448
+ */
449
+ interface FindEvaluatorsRequest {
450
+ projectId?: string;
451
+ name?: string;
452
+ page?: number;
453
+ size?: number;
454
+ }
455
+
456
+ /**
457
+ * This file was auto-generated by Fern from our API Definition.
458
+ */
459
+
460
+ /**
461
+ * @example
462
+ * {
463
+ * projectId: "project_id",
464
+ * body: {
465
+ * ids: ["ids"]
466
+ * }
467
+ * }
468
+ */
469
+ interface DeleteAutomationRuleEvaluatorBatchRequest {
470
+ projectId: string;
471
+ body: BatchDelete;
472
+ }
473
+
474
+ /**
475
+ * This file was auto-generated by Fern from our API Definition.
476
+ */
477
+ /**
478
+ * @example
479
+ * {}
480
+ */
481
+ interface GetEvaluatorByIdRequest {
482
+ projectId?: string;
483
+ }
484
+
485
+ /**
486
+ * This file was auto-generated by Fern from our API Definition.
487
+ */
488
+ /**
489
+ * @example
490
+ * {}
491
+ */
492
+ interface GetEvaluatorLogsByIdRequest {
493
+ size?: number;
494
+ }
495
+
496
+ /**
497
+ * This file was auto-generated by Fern from our API Definition.
498
+ */
499
+ /**
500
+ * @example
501
+ * {}
502
+ */
503
+ interface FindEvaluatorsDeprecatedRequest {
504
+ name?: string;
505
+ page?: number;
506
+ size?: number;
507
+ }
508
+
509
+ /**
510
+ * This file was auto-generated by Fern from our API Definition.
511
+ */
512
+ /**
513
+ * @example
514
+ * {}
515
+ */
516
+ interface GetEvaluatorLogsByIdDeprecatedRequest {
517
+ size?: number;
518
+ }
519
+
520
+ /**
521
+ * This file was auto-generated by Fern from our API Definition.
522
+ */
523
+
524
+ /**
525
+ * @example
526
+ * {}
527
+ */
528
+ interface ChatCompletionRequest {
529
+ model?: string;
530
+ messages?: Message[];
531
+ temperature?: number;
532
+ topP?: number;
533
+ n?: number;
534
+ stream?: boolean;
535
+ streamOptions?: StreamOptions;
536
+ stop?: string[];
537
+ maxTokens?: number;
538
+ maxCompletionTokens?: number;
539
+ presencePenalty?: number;
540
+ frequencyPenalty?: number;
541
+ logitBias?: Record<string, number>;
542
+ user?: string;
543
+ responseFormat?: ResponseFormat;
544
+ seed?: number;
545
+ tools?: Tool[];
546
+ toolChoice?: Record<string, unknown>;
547
+ parallelToolCalls?: boolean;
548
+ functions?: Function[];
549
+ functionCall?: FunctionCall;
550
+ }
551
+
552
+ /**
553
+ * This file was auto-generated by Fern from our API Definition.
554
+ */
555
+ /**
556
+ * @example
557
+ * {}
558
+ */
559
+ interface FindDatasetsRequest {
560
+ page?: number;
561
+ size?: number;
562
+ withExperimentsOnly?: boolean;
563
+ promptId?: string;
564
+ name?: string;
565
+ sorting?: string;
566
+ }
567
+
568
+ /**
569
+ * This file was auto-generated by Fern from our API Definition.
570
+ */
571
+ /**
572
+ * @example
573
+ * {
574
+ * name: "name"
575
+ * }
576
+ */
577
+ interface DatasetWrite {
578
+ id?: string;
579
+ name: string;
580
+ description?: string;
581
+ }
582
+
583
+ /**
584
+ * This file was auto-generated by Fern from our API Definition.
585
+ */
586
+
587
+ /**
588
+ * @example
589
+ * {
590
+ * items: [{
591
+ * source: "manual",
592
+ * data: {
593
+ * "key": "value"
594
+ * }
595
+ * }]
596
+ * }
597
+ */
598
+ interface DatasetItemBatchWrite {
599
+ /** If null, dataset_id must be provided */
600
+ datasetName?: string;
601
+ /** If null, dataset_name must be provided */
602
+ datasetId?: string;
603
+ items: DatasetItemWrite[];
604
+ }
605
+
606
+ /**
607
+ * This file was auto-generated by Fern from our API Definition.
608
+ */
609
+ /**
610
+ * @example
611
+ * {
612
+ * name: "name"
613
+ * }
614
+ */
615
+ interface DatasetUpdate {
616
+ name: string;
617
+ description?: string;
618
+ }
619
+
620
+ /**
621
+ * This file was auto-generated by Fern from our API Definition.
622
+ */
623
+ /**
624
+ * @example
625
+ * {
626
+ * datasetName: "dataset_name"
627
+ * }
628
+ */
629
+ interface DatasetIdentifier {
630
+ datasetName: string;
631
+ }
632
+
633
+ /**
634
+ * This file was auto-generated by Fern from our API Definition.
635
+ */
636
+ /**
637
+ * @example
638
+ * {
639
+ * itemIds: ["item_ids"]
640
+ * }
641
+ */
642
+ interface DatasetItemsDelete {
643
+ itemIds: string[];
644
+ }
645
+
646
+ /**
647
+ * This file was auto-generated by Fern from our API Definition.
648
+ */
649
+ /**
650
+ * @example
651
+ * {
652
+ * experimentIds: "experiment_ids"
653
+ * }
654
+ */
655
+ interface FindDatasetItemsWithExperimentItemsRequest {
656
+ page?: number;
657
+ size?: number;
658
+ experimentIds: string;
659
+ filters?: string;
660
+ truncate?: boolean;
661
+ }
662
+
663
+ /**
664
+ * This file was auto-generated by Fern from our API Definition.
665
+ */
666
+ /**
667
+ * @example
668
+ * {
669
+ * datasetName: "dataset_name"
670
+ * }
671
+ */
672
+ interface DatasetIdentifierPublic {
673
+ datasetName: string;
674
+ }
675
+
676
+ /**
677
+ * This file was auto-generated by Fern from our API Definition.
678
+ */
679
+ /**
680
+ * @example
681
+ * {}
682
+ */
683
+ interface GetDatasetItemsRequest {
684
+ page?: number;
685
+ size?: number;
686
+ truncate?: boolean;
687
+ }
688
+
689
+ /**
690
+ * This file was auto-generated by Fern from our API Definition.
691
+ */
692
+ /**
693
+ * @example
694
+ * {}
695
+ */
696
+ interface GetDatasetItemsOutputColumnsRequest {
697
+ experimentIds?: string;
698
+ }
699
+
700
+ /**
701
+ * This file was auto-generated by Fern from our API Definition.
702
+ */
703
+ interface DatasetItemStreamRequest {
704
+ datasetName: string;
705
+ lastRetrievedId?: string;
706
+ steamLimit?: number;
707
+ }
708
+
709
+ /**
710
+ * This file was auto-generated by Fern from our API Definition.
711
+ */
712
+ /**
713
+ * @example
714
+ * {}
715
+ */
716
+ interface FindExperimentsRequest {
717
+ page?: number;
718
+ size?: number;
719
+ datasetId?: string;
720
+ name?: string;
721
+ datasetDeleted?: boolean;
722
+ promptId?: string;
723
+ }
724
+
725
+ /**
726
+ * This file was auto-generated by Fern from our API Definition.
727
+ */
728
+
729
+ /**
730
+ * @example
731
+ * {
732
+ * datasetName: "dataset_name"
733
+ * }
734
+ */
735
+ interface ExperimentWrite {
736
+ id?: string;
737
+ datasetName: string;
738
+ name?: string;
739
+ metadata?: JsonNodeWrite;
740
+ promptVersion?: PromptVersionLinkWrite;
741
+ promptVersions?: PromptVersionLinkWrite[];
742
+ }
743
+
744
+ /**
745
+ * This file was auto-generated by Fern from our API Definition.
746
+ */
747
+
748
+ /**
749
+ * @example
750
+ * {
751
+ * experimentItems: [{
752
+ * experimentId: "experiment_id",
753
+ * datasetItemId: "dataset_item_id",
754
+ * traceId: "trace_id"
755
+ * }]
756
+ * }
757
+ */
758
+ interface ExperimentItemsBatch {
759
+ experimentItems: ExperimentItem[];
760
+ }
761
+
762
+ /**
763
+ * This file was auto-generated by Fern from our API Definition.
764
+ */
765
+ /**
766
+ * @example
767
+ * {
768
+ * ids: ["ids"]
769
+ * }
770
+ */
771
+ interface ExperimentItemsDelete {
772
+ ids: string[];
773
+ }
774
+
775
+ /**
776
+ * This file was auto-generated by Fern from our API Definition.
777
+ */
778
+ /**
779
+ * @example
780
+ * {
781
+ * ids: ["ids"]
782
+ * }
783
+ */
784
+ interface ExperimentsDelete {
785
+ ids: string[];
786
+ }
787
+
788
+ /**
789
+ * This file was auto-generated by Fern from our API Definition.
790
+ */
791
+ /**
792
+ * @example
793
+ * {}
794
+ */
795
+ interface FindFeedbackScoreNamesRequest {
796
+ experimentIds?: string;
797
+ }
798
+
799
+ /**
800
+ * This file was auto-generated by Fern from our API Definition.
801
+ */
802
+ /**
803
+ * @example
804
+ * {
805
+ * name: "name"
806
+ * }
807
+ */
808
+ interface IdentifierPublic {
809
+ name: string;
810
+ }
811
+
812
+ /**
813
+ * This file was auto-generated by Fern from our API Definition.
814
+ */
815
+ interface ExperimentItemStreamRequest {
816
+ experimentName: string;
817
+ limit?: number;
818
+ lastRetrievedId?: string;
819
+ /** Truncate image included in either input, output or metadata */
820
+ truncate?: boolean;
821
+ }
822
+
823
+ /**
824
+ * This file was auto-generated by Fern from our API Definition.
825
+ */
826
+ /**
827
+ * @example
828
+ * {}
829
+ */
830
+ interface GetTracesByProjectRequest {
831
+ page?: number;
832
+ size?: number;
833
+ projectName?: string;
834
+ projectId?: string;
835
+ filters?: string;
836
+ truncate?: boolean;
837
+ }
838
+
839
+ /**
840
+ * This file was auto-generated by Fern from our API Definition.
841
+ */
842
+
843
+ /**
844
+ * @example
845
+ * {
846
+ * traces: [{
847
+ * name: "name",
848
+ * startTime: "2024-01-15T09:30:00Z"
849
+ * }]
850
+ * }
851
+ */
852
+ interface TraceBatchWrite {
853
+ traces: TraceWrite[];
854
+ }
855
+
856
+ /**
857
+ * This file was auto-generated by Fern from our API Definition.
858
+ */
859
+
860
+ /**
861
+ * @example
862
+ * {}
863
+ */
864
+ interface TraceUpdate {
865
+ /** If null and project_id not specified, Default Project is assumed */
866
+ projectName?: string;
867
+ /** If null and project_name not specified, Default Project is assumed */
868
+ projectId?: string;
869
+ endTime?: Date;
870
+ input?: JsonNode;
871
+ output?: JsonNode;
872
+ metadata?: JsonNode;
873
+ tags?: string[];
874
+ errorInfo?: ErrorInfo;
875
+ }
876
+
877
+ /**
878
+ * This file was auto-generated by Fern from our API Definition.
879
+ */
880
+ /**
881
+ * @example
882
+ * {}
883
+ */
884
+ interface FindFeedbackScoreNames2Request {
885
+ projectId?: string;
886
+ }
887
+
888
+ /**
889
+ * This file was auto-generated by Fern from our API Definition.
890
+ */
891
+ /**
892
+ * @example
893
+ * {}
894
+ */
895
+ interface GetTraceStatsRequest {
896
+ projectId?: string;
897
+ projectName?: string;
898
+ filters?: string;
899
+ }
900
+
901
+ /**
902
+ * This file was auto-generated by Fern from our API Definition.
903
+ */
904
+ interface BiInformation {
905
+ workspaceId?: string;
906
+ user?: string;
907
+ count?: number;
908
+ }
909
+
910
+ /**
911
+ * This file was auto-generated by Fern from our API Definition.
912
+ */
913
+
914
+ interface BiInformationResponse {
915
+ biInformation?: BiInformation[];
916
+ }
917
+
918
+ /**
919
+ * This file was auto-generated by Fern from our API Definition.
920
+ */
921
+
922
+ interface TraceCountResponse {
923
+ workspacesTracesCount?: WorkspaceTraceCount[];
924
+ }
925
+
926
+ /**
927
+ * This file was auto-generated by Fern from our API Definition.
928
+ */
929
+ interface WorkspaceTraceCount {
930
+ workspace?: string;
931
+ traceCount?: number;
932
+ }
933
+
934
+ /**
935
+ * This file was auto-generated by Fern from our API Definition.
936
+ */
937
+ type AuthDetailsHolder = Record<string, unknown>;
938
+
939
+ /**
940
+ * This file was auto-generated by Fern from our API Definition.
941
+ */
942
+
943
+ interface LlmAsJudgeCode {
944
+ model: LlmAsJudgeModelParameters;
945
+ messages: LlmAsJudgeMessage[];
946
+ variables: Record<string, string>;
947
+ schema: LlmAsJudgeOutputSchema[];
948
+ }
949
+
950
+ /**
951
+ * This file was auto-generated by Fern from our API Definition.
952
+ */
953
+ type LlmAsJudgeMessageRole = "SYSTEM" | "USER" | "AI" | "TOOL_EXECUTION_RESULT";
954
+ declare const LlmAsJudgeMessageRole: {
955
+ readonly System: "SYSTEM";
956
+ readonly User: "USER";
957
+ readonly Ai: "AI";
958
+ readonly ToolExecutionResult: "TOOL_EXECUTION_RESULT";
959
+ };
960
+
961
+ /**
962
+ * This file was auto-generated by Fern from our API Definition.
963
+ */
964
+
965
+ interface LlmAsJudgeMessage {
966
+ role: LlmAsJudgeMessageRole;
967
+ content: string;
968
+ }
969
+
970
+ /**
971
+ * This file was auto-generated by Fern from our API Definition.
972
+ */
973
+ interface LlmAsJudgeModelParameters {
974
+ name: string;
975
+ temperature: number;
976
+ }
977
+
978
+ /**
979
+ * This file was auto-generated by Fern from our API Definition.
980
+ */
981
+ type LlmAsJudgeOutputSchemaType = "BOOLEAN" | "INTEGER" | "DOUBLE";
982
+ declare const LlmAsJudgeOutputSchemaType: {
983
+ readonly Boolean: "BOOLEAN";
984
+ readonly Integer: "INTEGER";
985
+ readonly Double: "DOUBLE";
986
+ };
987
+
988
+ /**
989
+ * This file was auto-generated by Fern from our API Definition.
990
+ */
991
+
992
+ interface LlmAsJudgeOutputSchema {
993
+ name: string;
994
+ type: LlmAsJudgeOutputSchemaType;
995
+ description: string;
996
+ }
997
+
998
+ /**
999
+ * This file was auto-generated by Fern from our API Definition.
1000
+ */
1001
+
1002
+ interface AutomationRuleEvaluatorLlmAsJudgeWrite {
1003
+ code?: LlmAsJudgeCodeWrite;
1004
+ }
1005
+
1006
+ /**
1007
+ * This file was auto-generated by Fern from our API Definition.
1008
+ */
1009
+
1010
+ type AutomationRuleEvaluatorWrite = AutomationRuleEvaluatorWrite.LlmAsJudge;
1011
+ declare namespace AutomationRuleEvaluatorWrite {
1012
+ interface LlmAsJudge extends AutomationRuleEvaluatorLlmAsJudgeWrite, _Base {
1013
+ type: "llm_as_judge";
1014
+ }
1015
+ interface _Base {
1016
+ projectId?: string;
1017
+ name: string;
1018
+ samplingRate?: number;
1019
+ action?: "evaluator";
1020
+ }
1021
+ }
1022
+
1023
+ /**
1024
+ * This file was auto-generated by Fern from our API Definition.
1025
+ */
1026
+
1027
+ interface LlmAsJudgeCodeWrite {
1028
+ model: LlmAsJudgeModelParametersWrite;
1029
+ messages: LlmAsJudgeMessageWrite[];
1030
+ variables: Record<string, string>;
1031
+ schema: LlmAsJudgeOutputSchemaWrite[];
1032
+ }
1033
+
1034
+ /**
1035
+ * This file was auto-generated by Fern from our API Definition.
1036
+ */
1037
+ type LlmAsJudgeMessageWriteRole = "SYSTEM" | "USER" | "AI" | "TOOL_EXECUTION_RESULT";
1038
+ declare const LlmAsJudgeMessageWriteRole: {
1039
+ readonly System: "SYSTEM";
1040
+ readonly User: "USER";
1041
+ readonly Ai: "AI";
1042
+ readonly ToolExecutionResult: "TOOL_EXECUTION_RESULT";
1043
+ };
1044
+
1045
+ /**
1046
+ * This file was auto-generated by Fern from our API Definition.
1047
+ */
1048
+
1049
+ interface LlmAsJudgeMessageWrite {
1050
+ role: LlmAsJudgeMessageWriteRole;
1051
+ content: string;
1052
+ }
1053
+
1054
+ /**
1055
+ * This file was auto-generated by Fern from our API Definition.
1056
+ */
1057
+ interface LlmAsJudgeModelParametersWrite {
1058
+ name: string;
1059
+ temperature: number;
1060
+ }
1061
+
1062
+ /**
1063
+ * This file was auto-generated by Fern from our API Definition.
1064
+ */
1065
+ type LlmAsJudgeOutputSchemaWriteType = "BOOLEAN" | "INTEGER" | "DOUBLE";
1066
+ declare const LlmAsJudgeOutputSchemaWriteType: {
1067
+ readonly Boolean: "BOOLEAN";
1068
+ readonly Integer: "INTEGER";
1069
+ readonly Double: "DOUBLE";
1070
+ };
1071
+
1072
+ /**
1073
+ * This file was auto-generated by Fern from our API Definition.
1074
+ */
1075
+
1076
+ interface LlmAsJudgeOutputSchemaWrite {
1077
+ name: string;
1078
+ type: LlmAsJudgeOutputSchemaWriteType;
1079
+ description: string;
1080
+ }
1081
+
1082
+ /**
1083
+ * This file was auto-generated by Fern from our API Definition.
1084
+ */
1085
+ interface BatchDelete {
1086
+ ids: string[];
1087
+ }
1088
+
1089
+ /**
1090
+ * This file was auto-generated by Fern from our API Definition.
1091
+ */
1092
+
1093
+ interface AutomationRuleEvaluatorLlmAsJudgePublic {
1094
+ code?: LlmAsJudgeCodePublic;
1095
+ }
1096
+
1097
+ /**
1098
+ * This file was auto-generated by Fern from our API Definition.
1099
+ */
1100
+
1101
+ type AutomationRuleEvaluatorObjectPublic = AutomationRuleEvaluatorObjectPublic.LlmAsJudge;
1102
+ declare namespace AutomationRuleEvaluatorObjectPublic {
1103
+ interface LlmAsJudge extends AutomationRuleEvaluatorLlmAsJudgePublic, _Base {
1104
+ type: "llm_as_judge";
1105
+ }
1106
+ interface _Base {
1107
+ id?: string;
1108
+ projectId?: string;
1109
+ name: string;
1110
+ samplingRate?: number;
1111
+ createdAt?: Date;
1112
+ createdBy?: string;
1113
+ lastUpdatedAt?: Date;
1114
+ lastUpdatedBy?: string;
1115
+ action?: "evaluator";
1116
+ }
1117
+ }
1118
+
1119
+ /**
1120
+ * This file was auto-generated by Fern from our API Definition.
1121
+ */
1122
+
1123
+ interface AutomationRuleEvaluatorPagePublic {
1124
+ page?: number;
1125
+ size?: number;
1126
+ total?: number;
1127
+ content?: AutomationRuleEvaluatorObjectPublic[];
1128
+ }
1129
+
1130
+ /**
1131
+ * This file was auto-generated by Fern from our API Definition.
1132
+ */
1133
+
1134
+ interface LlmAsJudgeCodePublic {
1135
+ model: LlmAsJudgeModelParametersPublic;
1136
+ messages: LlmAsJudgeMessagePublic[];
1137
+ variables: Record<string, string>;
1138
+ schema: LlmAsJudgeOutputSchemaPublic[];
1139
+ }
1140
+
1141
+ /**
1142
+ * This file was auto-generated by Fern from our API Definition.
1143
+ */
1144
+ type LlmAsJudgeMessagePublicRole = "SYSTEM" | "USER" | "AI" | "TOOL_EXECUTION_RESULT";
1145
+ declare const LlmAsJudgeMessagePublicRole: {
1146
+ readonly System: "SYSTEM";
1147
+ readonly User: "USER";
1148
+ readonly Ai: "AI";
1149
+ readonly ToolExecutionResult: "TOOL_EXECUTION_RESULT";
1150
+ };
1151
+
1152
+ /**
1153
+ * This file was auto-generated by Fern from our API Definition.
1154
+ */
1155
+
1156
+ interface LlmAsJudgeMessagePublic {
1157
+ role: LlmAsJudgeMessagePublicRole;
1158
+ content: string;
1159
+ }
1160
+
1161
+ /**
1162
+ * This file was auto-generated by Fern from our API Definition.
1163
+ */
1164
+ interface LlmAsJudgeModelParametersPublic {
1165
+ name: string;
1166
+ temperature: number;
1167
+ }
1168
+
1169
+ /**
1170
+ * This file was auto-generated by Fern from our API Definition.
1171
+ */
1172
+ type LlmAsJudgeOutputSchemaPublicType = "BOOLEAN" | "INTEGER" | "DOUBLE";
1173
+ declare const LlmAsJudgeOutputSchemaPublicType: {
1174
+ readonly Boolean: "BOOLEAN";
1175
+ readonly Integer: "INTEGER";
1176
+ readonly Double: "DOUBLE";
1177
+ };
1178
+
1179
+ /**
1180
+ * This file was auto-generated by Fern from our API Definition.
1181
+ */
1182
+
1183
+ interface LlmAsJudgeOutputSchemaPublic {
1184
+ name: string;
1185
+ type: LlmAsJudgeOutputSchemaPublicType;
1186
+ description: string;
1187
+ }
1188
+
1189
+ /**
1190
+ * This file was auto-generated by Fern from our API Definition.
1191
+ */
1192
+
1193
+ type AutomationRuleEvaluatorPublic = AutomationRuleEvaluatorPublic.LlmAsJudge;
1194
+ declare namespace AutomationRuleEvaluatorPublic {
1195
+ interface LlmAsJudge extends AutomationRuleEvaluatorLlmAsJudgePublic, _Base {
1196
+ type: "llm_as_judge";
1197
+ }
1198
+ interface _Base {
1199
+ id?: string;
1200
+ projectId?: string;
1201
+ name: string;
1202
+ samplingRate?: number;
1203
+ createdAt?: Date;
1204
+ createdBy?: string;
1205
+ lastUpdatedAt?: Date;
1206
+ lastUpdatedBy?: string;
1207
+ action?: "evaluator";
1208
+ }
1209
+ }
1210
+
1211
+ /**
1212
+ * This file was auto-generated by Fern from our API Definition.
1213
+ */
1214
+ type LogItemLevel = "INFO" | "WARN" | "ERROR" | "DEBUG" | "TRACE";
1215
+ declare const LogItemLevel: {
1216
+ readonly Info: "INFO";
1217
+ readonly Warn: "WARN";
1218
+ readonly Error: "ERROR";
1219
+ readonly Debug: "DEBUG";
1220
+ readonly Trace: "TRACE";
1221
+ };
1222
+
1223
+ /**
1224
+ * This file was auto-generated by Fern from our API Definition.
1225
+ */
1226
+
1227
+ interface LogItem {
1228
+ timestamp?: Date;
1229
+ ruleId?: string;
1230
+ level?: LogItemLevel;
1231
+ message?: string;
1232
+ markers?: Record<string, string>;
1233
+ }
1234
+
1235
+ /**
1236
+ * This file was auto-generated by Fern from our API Definition.
1237
+ */
1238
+
1239
+ interface LogPage {
1240
+ content?: LogItem[];
1241
+ page?: number;
1242
+ size?: number;
1243
+ total?: number;
1244
+ }
1245
+
1246
+ /**
1247
+ * This file was auto-generated by Fern from our API Definition.
1248
+ */
1249
+
1250
+ interface AutomationRuleEvaluatorUpdate {
1251
+ name: string;
1252
+ code: LlmAsJudgeCode;
1253
+ samplingRate: number;
1254
+ projectId?: string;
1255
+ }
1256
+
1257
+ /**
1258
+ * This file was auto-generated by Fern from our API Definition.
1259
+ */
1260
+ type AssistantMessageRole = "system" | "user" | "assistant" | "tool" | "function";
1261
+ declare const AssistantMessageRole: {
1262
+ readonly System: "system";
1263
+ readonly User: "user";
1264
+ readonly Assistant: "assistant";
1265
+ readonly Tool: "tool";
1266
+ readonly Function: "function";
1267
+ };
1268
+
1269
+ /**
1270
+ * This file was auto-generated by Fern from our API Definition.
1271
+ */
1272
+
1273
+ interface AssistantMessage {
1274
+ role?: AssistantMessageRole;
1275
+ content?: string;
1276
+ name?: string;
1277
+ toolCalls?: ToolCall[];
1278
+ refusal?: boolean;
1279
+ functionCall?: FunctionCall;
1280
+ }
1281
+
1282
+ /**
1283
+ * This file was auto-generated by Fern from our API Definition.
1284
+ */
1285
+
1286
+ interface ChatCompletionChoice {
1287
+ index?: number;
1288
+ message?: AssistantMessage;
1289
+ delta?: Delta;
1290
+ finishReason?: string;
1291
+ }
1292
+
1293
+ /**
1294
+ * This file was auto-generated by Fern from our API Definition.
1295
+ */
1296
+
1297
+ interface ChatCompletionResponse {
1298
+ id?: string;
1299
+ created?: number;
1300
+ model?: string;
1301
+ choices?: ChatCompletionChoice[];
1302
+ usage?: Usage;
1303
+ systemFingerprint?: string;
1304
+ }
1305
+
1306
+ /**
1307
+ * This file was auto-generated by Fern from our API Definition.
1308
+ */
1309
+ interface CompletionTokensDetails {
1310
+ reasoningTokens?: number;
1311
+ }
1312
+
1313
+ /**
1314
+ * This file was auto-generated by Fern from our API Definition.
1315
+ */
1316
+ type DeltaRole = "system" | "user" | "assistant" | "tool" | "function";
1317
+ declare const DeltaRole: {
1318
+ readonly System: "system";
1319
+ readonly User: "user";
1320
+ readonly Assistant: "assistant";
1321
+ readonly Tool: "tool";
1322
+ readonly Function: "function";
1323
+ };
1324
+
1325
+ /**
1326
+ * This file was auto-generated by Fern from our API Definition.
1327
+ */
1328
+
1329
+ interface Delta {
1330
+ role?: DeltaRole;
1331
+ content?: string;
1332
+ toolCalls?: ToolCall[];
1333
+ functionCall?: FunctionCall;
1334
+ }
1335
+
1336
+ /**
1337
+ * This file was auto-generated by Fern from our API Definition.
1338
+ */
1339
+ interface FunctionCall {
1340
+ name?: string;
1341
+ arguments?: string;
1342
+ }
1343
+
1344
+ /**
1345
+ * This file was auto-generated by Fern from our API Definition.
1346
+ */
1347
+
1348
+ interface ToolCall {
1349
+ id?: string;
1350
+ index?: number;
1351
+ type?: "function";
1352
+ function?: FunctionCall;
1353
+ }
1354
+
1355
+ /**
1356
+ * This file was auto-generated by Fern from our API Definition.
1357
+ */
1358
+
1359
+ interface Usage {
1360
+ totalTokens?: number;
1361
+ promptTokens?: number;
1362
+ completionTokens?: number;
1363
+ completionTokensDetails?: CompletionTokensDetails;
1364
+ }
1365
+
1366
+ /**
1367
+ * This file was auto-generated by Fern from our API Definition.
1368
+ */
1369
+
1370
+ interface Function {
1371
+ name?: string;
1372
+ description?: string;
1373
+ strict?: boolean;
1374
+ parameters?: JsonObjectSchema;
1375
+ }
1376
+
1377
+ /**
1378
+ * This file was auto-generated by Fern from our API Definition.
1379
+ */
1380
+
1381
+ interface JsonObjectSchema {
1382
+ type?: string;
1383
+ description?: string;
1384
+ properties?: Record<string, JsonSchemaElement>;
1385
+ required?: string[];
1386
+ additionalProperties?: boolean;
1387
+ defs?: Record<string, JsonSchemaElement>;
1388
+ }
1389
+
1390
+ /**
1391
+ * This file was auto-generated by Fern from our API Definition.
1392
+ */
1393
+
1394
+ interface JsonSchema {
1395
+ name?: string;
1396
+ strict?: boolean;
1397
+ schema?: JsonObjectSchema;
1398
+ }
1399
+
1400
+ /**
1401
+ * This file was auto-generated by Fern from our API Definition.
1402
+ */
1403
+ interface JsonSchemaElement {
1404
+ type?: string;
1405
+ }
1406
+
1407
+ /**
1408
+ * This file was auto-generated by Fern from our API Definition.
1409
+ */
1410
+ type Message = Record<string, unknown>;
1411
+
1412
+ /**
1413
+ * This file was auto-generated by Fern from our API Definition.
1414
+ */
1415
+ type ResponseFormatType = "text" | "json_object" | "json_schema";
1416
+ declare const ResponseFormatType: {
1417
+ readonly Text: "text";
1418
+ readonly JsonObject: "json_object";
1419
+ readonly JsonSchema: "json_schema";
1420
+ };
1421
+
1422
+ /**
1423
+ * This file was auto-generated by Fern from our API Definition.
1424
+ */
1425
+
1426
+ interface ResponseFormat {
1427
+ type?: ResponseFormatType;
1428
+ jsonSchema?: JsonSchema;
1429
+ }
1430
+
1431
+ /**
1432
+ * This file was auto-generated by Fern from our API Definition.
1433
+ */
1434
+ interface StreamOptions {
1435
+ includeUsage?: boolean;
1436
+ }
1437
+
1438
+ /**
1439
+ * This file was auto-generated by Fern from our API Definition.
1440
+ */
1441
+
1442
+ interface Tool {
1443
+ type?: "function";
1444
+ function?: Function;
1445
+ }
1446
+
1447
+ /**
1448
+ * This file was auto-generated by Fern from our API Definition.
1449
+ */
1450
+ interface Comment {
1451
+ id?: string;
1452
+ text: string;
1453
+ createdAt?: Date;
1454
+ lastUpdatedAt?: Date;
1455
+ createdBy?: string;
1456
+ lastUpdatedBy?: string;
1457
+ }
1458
+
1459
+ /**
1460
+ * This file was auto-generated by Fern from our API Definition.
1461
+ */
1462
+
1463
+ interface ExperimentItem {
1464
+ id?: string;
1465
+ experimentId: string;
1466
+ datasetItemId: string;
1467
+ traceId: string;
1468
+ input?: JsonNode;
1469
+ output?: JsonNode;
1470
+ feedbackScores?: FeedbackScore[];
1471
+ comments?: Comment[];
1472
+ createdAt?: Date;
1473
+ lastUpdatedAt?: Date;
1474
+ createdBy?: string;
1475
+ lastUpdatedBy?: string;
1476
+ }
1477
+
1478
+ /**
1479
+ * This file was auto-generated by Fern from our API Definition.
1480
+ */
1481
+ type FeedbackScoreSource = "ui" | "sdk" | "online_scoring";
1482
+ declare const FeedbackScoreSource: {
1483
+ readonly Ui: "ui";
1484
+ readonly Sdk: "sdk";
1485
+ readonly OnlineScoring: "online_scoring";
1486
+ };
1487
+
1488
+ /**
1489
+ * This file was auto-generated by Fern from our API Definition.
1490
+ */
1491
+
1492
+ interface FeedbackScore {
1493
+ name: string;
1494
+ categoryName?: string;
1495
+ value: number;
1496
+ reason?: string;
1497
+ source: FeedbackScoreSource;
1498
+ createdAt?: Date;
1499
+ lastUpdatedAt?: Date;
1500
+ createdBy?: string;
1501
+ lastUpdatedBy?: string;
1502
+ }
1503
+
1504
+ /**
1505
+ * This file was auto-generated by Fern from our API Definition.
1506
+ */
1507
+ type JsonNode = Record<string, unknown>;
1508
+
1509
+ /**
1510
+ * This file was auto-generated by Fern from our API Definition.
1511
+ */
1512
+ type DatasetItemWriteSource = "manual" | "trace" | "span" | "sdk";
1513
+ declare const DatasetItemWriteSource: {
1514
+ readonly Manual: "manual";
1515
+ readonly Trace: "trace";
1516
+ readonly Span: "span";
1517
+ readonly Sdk: "sdk";
1518
+ };
1519
+
1520
+ /**
1521
+ * This file was auto-generated by Fern from our API Definition.
1522
+ */
1523
+
1524
+ interface DatasetItemWrite {
1525
+ id?: string;
1526
+ traceId?: string;
1527
+ spanId?: string;
1528
+ source: DatasetItemWriteSource;
1529
+ data: JsonNode;
1530
+ }
1531
+
1532
+ /**
1533
+ * This file was auto-generated by Fern from our API Definition.
1534
+ */
1535
+ type ColumnCompareTypesItem = "string" | "number" | "object" | "boolean" | "array" | "null";
1536
+ declare const ColumnCompareTypesItem: {
1537
+ readonly String: "string";
1538
+ readonly Number: "number";
1539
+ readonly Object: "object";
1540
+ readonly Boolean: "boolean";
1541
+ readonly Array: "array";
1542
+ readonly Null: "null";
1543
+ };
1544
+
1545
+ /**
1546
+ * This file was auto-generated by Fern from our API Definition.
1547
+ */
1548
+
1549
+ interface ColumnCompare {
1550
+ name?: string;
1551
+ types?: ColumnCompareTypesItem[];
1552
+ filterFieldPrefix?: string;
1553
+ /** The field to use for filtering */
1554
+ filterField?: string;
1555
+ }
1556
+
1557
+ /**
1558
+ * This file was auto-generated by Fern from our API Definition.
1559
+ */
1560
+ interface CommentCompare {
1561
+ id?: string;
1562
+ text: string;
1563
+ createdAt?: Date;
1564
+ lastUpdatedAt?: Date;
1565
+ createdBy?: string;
1566
+ lastUpdatedBy?: string;
1567
+ }
1568
+
1569
+ /**
1570
+ * This file was auto-generated by Fern from our API Definition.
1571
+ */
1572
+
1573
+ interface DatasetItemPageCompare {
1574
+ content?: DatasetItemCompare[];
1575
+ page?: number;
1576
+ size?: number;
1577
+ total?: number;
1578
+ columns?: ColumnCompare[];
1579
+ }
1580
+
1581
+ /**
1582
+ * This file was auto-generated by Fern from our API Definition.
1583
+ */
1584
+ type DatasetItemCompareSource = "manual" | "trace" | "span" | "sdk";
1585
+ declare const DatasetItemCompareSource: {
1586
+ readonly Manual: "manual";
1587
+ readonly Trace: "trace";
1588
+ readonly Span: "span";
1589
+ readonly Sdk: "sdk";
1590
+ };
1591
+
1592
+ /**
1593
+ * This file was auto-generated by Fern from our API Definition.
1594
+ */
1595
+
1596
+ interface DatasetItemCompare {
1597
+ id?: string;
1598
+ traceId?: string;
1599
+ spanId?: string;
1600
+ source: DatasetItemCompareSource;
1601
+ data: JsonNode;
1602
+ experimentItems?: ExperimentItemCompare[];
1603
+ createdAt?: Date;
1604
+ lastUpdatedAt?: Date;
1605
+ createdBy?: string;
1606
+ lastUpdatedBy?: string;
1607
+ }
1608
+
1609
+ /**
1610
+ * This file was auto-generated by Fern from our API Definition.
1611
+ */
1612
+
1613
+ interface ExperimentItemCompare {
1614
+ id?: string;
1615
+ experimentId: string;
1616
+ datasetItemId: string;
1617
+ traceId: string;
1618
+ input?: JsonNodeCompare;
1619
+ output?: JsonNodeCompare;
1620
+ feedbackScores?: FeedbackScoreCompare[];
1621
+ comments?: CommentCompare[];
1622
+ createdAt?: Date;
1623
+ lastUpdatedAt?: Date;
1624
+ createdBy?: string;
1625
+ lastUpdatedBy?: string;
1626
+ }
1627
+
1628
+ /**
1629
+ * This file was auto-generated by Fern from our API Definition.
1630
+ */
1631
+ type FeedbackScoreCompareSource = "ui" | "sdk" | "online_scoring";
1632
+ declare const FeedbackScoreCompareSource: {
1633
+ readonly Ui: "ui";
1634
+ readonly Sdk: "sdk";
1635
+ readonly OnlineScoring: "online_scoring";
1636
+ };
1637
+
1638
+ /**
1639
+ * This file was auto-generated by Fern from our API Definition.
1640
+ */
1641
+
1642
+ interface FeedbackScoreCompare {
1643
+ name: string;
1644
+ categoryName?: string;
1645
+ value: number;
1646
+ reason?: string;
1647
+ source: FeedbackScoreCompareSource;
1648
+ createdAt?: Date;
1649
+ lastUpdatedAt?: Date;
1650
+ createdBy?: string;
1651
+ lastUpdatedBy?: string;
1652
+ }
1653
+
1654
+ /**
1655
+ * This file was auto-generated by Fern from our API Definition.
1656
+ */
1657
+ type JsonNodeCompare = Record<string, unknown>;
1658
+
1659
+ /**
1660
+ * This file was auto-generated by Fern from our API Definition.
1661
+ */
1662
+
1663
+ interface DatasetPagePublic {
1664
+ content?: DatasetPublic[];
1665
+ page?: number;
1666
+ size?: number;
1667
+ total?: number;
1668
+ }
1669
+
1670
+ /**
1671
+ * This file was auto-generated by Fern from our API Definition.
1672
+ */
1673
+ interface DatasetPublic {
1674
+ id?: string;
1675
+ name: string;
1676
+ description?: string;
1677
+ createdAt?: Date;
1678
+ createdBy?: string;
1679
+ lastUpdatedAt?: Date;
1680
+ lastUpdatedBy?: string;
1681
+ experimentCount?: number;
1682
+ datasetItemsCount?: number;
1683
+ mostRecentExperimentAt?: Date;
1684
+ lastCreatedExperimentAt?: Date;
1685
+ }
1686
+
1687
+ /**
1688
+ * This file was auto-generated by Fern from our API Definition.
1689
+ */
1690
+ type DatasetItemPublicSource = "manual" | "trace" | "span" | "sdk";
1691
+ declare const DatasetItemPublicSource: {
1692
+ readonly Manual: "manual";
1693
+ readonly Trace: "trace";
1694
+ readonly Span: "span";
1695
+ readonly Sdk: "sdk";
1696
+ };
1697
+
1698
+ /**
1699
+ * This file was auto-generated by Fern from our API Definition.
1700
+ */
1701
+
1702
+ interface DatasetItemPublic {
1703
+ id?: string;
1704
+ traceId?: string;
1705
+ spanId?: string;
1706
+ source: DatasetItemPublicSource;
1707
+ data: JsonNode;
1708
+ experimentItems?: ExperimentItemPublic[];
1709
+ createdAt?: Date;
1710
+ lastUpdatedAt?: Date;
1711
+ createdBy?: string;
1712
+ lastUpdatedBy?: string;
1713
+ }
1714
+
1715
+ /**
1716
+ * This file was auto-generated by Fern from our API Definition.
1717
+ */
1718
+ interface ExperimentItemPublic {
1719
+ id?: string;
1720
+ experimentId: string;
1721
+ datasetItemId: string;
1722
+ traceId: string;
1723
+ createdAt?: Date;
1724
+ lastUpdatedAt?: Date;
1725
+ createdBy?: string;
1726
+ lastUpdatedBy?: string;
1727
+ }
1728
+
1729
+ /**
1730
+ * This file was auto-generated by Fern from our API Definition.
1731
+ */
1732
+ type ColumnPublicTypesItem = "string" | "number" | "object" | "boolean" | "array" | "null";
1733
+ declare const ColumnPublicTypesItem: {
1734
+ readonly String: "string";
1735
+ readonly Number: "number";
1736
+ readonly Object: "object";
1737
+ readonly Boolean: "boolean";
1738
+ readonly Array: "array";
1739
+ readonly Null: "null";
1740
+ };
1741
+
1742
+ /**
1743
+ * This file was auto-generated by Fern from our API Definition.
1744
+ */
1745
+
1746
+ interface ColumnPublic {
1747
+ name?: string;
1748
+ types?: ColumnPublicTypesItem[];
1749
+ filterFieldPrefix?: string;
1750
+ /** The field to use for filtering */
1751
+ filterField?: string;
1752
+ }
1753
+
1754
+ /**
1755
+ * This file was auto-generated by Fern from our API Definition.
1756
+ */
1757
+
1758
+ interface DatasetItemPagePublic {
1759
+ content?: DatasetItemPublic[];
1760
+ page?: number;
1761
+ size?: number;
1762
+ total?: number;
1763
+ columns?: ColumnPublic[];
1764
+ }
1765
+
1766
+ /**
1767
+ * This file was auto-generated by Fern from our API Definition.
1768
+ */
1769
+ type ColumnTypesItem = "string" | "number" | "object" | "boolean" | "array" | "null";
1770
+ declare const ColumnTypesItem: {
1771
+ readonly String: "string";
1772
+ readonly Number: "number";
1773
+ readonly Object: "object";
1774
+ readonly Boolean: "boolean";
1775
+ readonly Array: "array";
1776
+ readonly Null: "null";
1777
+ };
1778
+
1779
+ /**
1780
+ * This file was auto-generated by Fern from our API Definition.
1781
+ */
1782
+
1783
+ interface Column {
1784
+ name?: string;
1785
+ types?: ColumnTypesItem[];
1786
+ filterFieldPrefix?: string;
1787
+ /** The field to use for filtering */
1788
+ filterField?: string;
1789
+ }
1790
+
1791
+ /**
1792
+ * This file was auto-generated by Fern from our API Definition.
1793
+ */
1794
+
1795
+ interface PageColumns {
1796
+ columns?: Column[];
1797
+ }
1798
+
1799
+ /**
1800
+ * This file was auto-generated by Fern from our API Definition.
1801
+ */
1802
+ interface FeedbackScoreAverage {
1803
+ name: string;
1804
+ value: number;
1805
+ }
1806
+
1807
+ /**
1808
+ * This file was auto-generated by Fern from our API Definition.
1809
+ */
1810
+ type JsonNodeWrite = Record<string, unknown>;
1811
+
1812
+ /**
1813
+ * This file was auto-generated by Fern from our API Definition.
1814
+ */
1815
+ interface PromptVersionLinkWrite {
1816
+ id: string;
1817
+ }
1818
+
1819
+ /**
1820
+ * This file was auto-generated by Fern from our API Definition.
1821
+ */
1822
+ interface CommentPublic {
1823
+ id?: string;
1824
+ text: string;
1825
+ createdAt?: Date;
1826
+ lastUpdatedAt?: Date;
1827
+ createdBy?: string;
1828
+ lastUpdatedBy?: string;
1829
+ }
1830
+
1831
+ /**
1832
+ * This file was auto-generated by Fern from our API Definition.
1833
+ */
1834
+
1835
+ interface ExperimentPagePublic {
1836
+ page?: number;
1837
+ size?: number;
1838
+ total?: number;
1839
+ content?: ExperimentPublic[];
1840
+ }
1841
+
1842
+ /**
1843
+ * This file was auto-generated by Fern from our API Definition.
1844
+ */
1845
+
1846
+ interface ExperimentPublic {
1847
+ id?: string;
1848
+ datasetName: string;
1849
+ datasetId?: string;
1850
+ name?: string;
1851
+ metadata?: JsonNodePublic;
1852
+ feedbackScores?: FeedbackScoreAveragePublic[];
1853
+ comments?: CommentPublic[];
1854
+ traceCount?: number;
1855
+ createdAt?: Date;
1856
+ lastUpdatedAt?: Date;
1857
+ createdBy?: string;
1858
+ lastUpdatedBy?: string;
1859
+ promptVersion?: PromptVersionLinkPublic;
1860
+ promptVersions?: PromptVersionLinkPublic[];
1861
+ }
1862
+
1863
+ /**
1864
+ * This file was auto-generated by Fern from our API Definition.
1865
+ */
1866
+ interface FeedbackScoreAveragePublic {
1867
+ name: string;
1868
+ value: number;
1869
+ }
1870
+
1871
+ /**
1872
+ * This file was auto-generated by Fern from our API Definition.
1873
+ */
1874
+ type JsonNodePublic = Record<string, unknown>;
1875
+
1876
+ /**
1877
+ * This file was auto-generated by Fern from our API Definition.
1878
+ */
1879
+ interface PromptVersionLinkPublic {
1880
+ id: string;
1881
+ commit?: string;
1882
+ promptId?: string;
1883
+ }
1884
+
1885
+ /**
1886
+ * This file was auto-generated by Fern from our API Definition.
1887
+ */
1888
+
1889
+ interface CategoricalFeedbackDefinitionCreate {
1890
+ details?: CategoricalFeedbackDetailCreate;
1891
+ }
1892
+
1893
+ /**
1894
+ * This file was auto-generated by Fern from our API Definition.
1895
+ */
1896
+ interface CategoricalFeedbackDetailCreate {
1897
+ categories: Record<string, number>;
1898
+ }
1899
+
1900
+ /**
1901
+ * This file was auto-generated by Fern from our API Definition.
1902
+ */
1903
+
1904
+ type FeedbackCreate = FeedbackCreate.Numerical | FeedbackCreate.Categorical;
1905
+ declare namespace FeedbackCreate {
1906
+ interface Numerical extends NumericalFeedbackDefinitionCreate, _Base {
1907
+ type: "numerical";
1908
+ }
1909
+ interface Categorical extends CategoricalFeedbackDefinitionCreate, _Base {
1910
+ type: "categorical";
1911
+ }
1912
+ interface _Base {
1913
+ id?: string;
1914
+ name: string;
1915
+ }
1916
+ }
1917
+
1918
+ /**
1919
+ * This file was auto-generated by Fern from our API Definition.
1920
+ */
1921
+
1922
+ interface NumericalFeedbackDefinitionCreate {
1923
+ details?: NumericalFeedbackDetailCreate;
1924
+ }
1925
+
1926
+ /**
1927
+ * This file was auto-generated by Fern from our API Definition.
1928
+ */
1929
+ interface NumericalFeedbackDetailCreate {
1930
+ max: number;
1931
+ min: number;
1932
+ }
1933
+
1934
+ /**
1935
+ * This file was auto-generated by Fern from our API Definition.
1936
+ */
1937
+
1938
+ interface CategoricalFeedbackDefinitionPublic {
1939
+ details?: CategoricalFeedbackDetailPublic;
1940
+ createdAt?: Date;
1941
+ createdBy?: string;
1942
+ lastUpdatedAt?: Date;
1943
+ lastUpdatedBy?: string;
1944
+ }
1945
+
1946
+ /**
1947
+ * This file was auto-generated by Fern from our API Definition.
1948
+ */
1949
+ interface CategoricalFeedbackDetailPublic {
1950
+ categories: Record<string, number>;
1951
+ }
1952
+
1953
+ /**
1954
+ * This file was auto-generated by Fern from our API Definition.
1955
+ */
1956
+
1957
+ interface FeedbackDefinitionPagePublic {
1958
+ page?: number;
1959
+ size?: number;
1960
+ total?: number;
1961
+ content?: FeedbackObjectPublic[];
1962
+ }
1963
+
1964
+ /**
1965
+ * This file was auto-generated by Fern from our API Definition.
1966
+ */
1967
+
1968
+ type FeedbackObjectPublic = FeedbackObjectPublic.Numerical | FeedbackObjectPublic.Categorical;
1969
+ declare namespace FeedbackObjectPublic {
1970
+ interface Numerical extends NumericalFeedbackDefinitionPublic, _Base {
1971
+ type: "numerical";
1972
+ }
1973
+ interface Categorical extends CategoricalFeedbackDefinitionPublic, _Base {
1974
+ type: "categorical";
1975
+ }
1976
+ interface _Base {
1977
+ id?: string;
1978
+ name: string;
1979
+ createdAt?: Date;
1980
+ createdBy?: string;
1981
+ lastUpdatedAt?: Date;
1982
+ lastUpdatedBy?: string;
1983
+ }
1984
+ }
1985
+
1986
+ /**
1987
+ * This file was auto-generated by Fern from our API Definition.
1988
+ */
1989
+
1990
+ interface NumericalFeedbackDefinitionPublic {
1991
+ details?: NumericalFeedbackDetailPublic;
1992
+ createdAt?: Date;
1993
+ createdBy?: string;
1994
+ lastUpdatedAt?: Date;
1995
+ lastUpdatedBy?: string;
1996
+ }
1997
+
1998
+ /**
1999
+ * This file was auto-generated by Fern from our API Definition.
2000
+ */
2001
+ interface NumericalFeedbackDetailPublic {
2002
+ max: number;
2003
+ min: number;
2004
+ }
2005
+
2006
+ /**
2007
+ * This file was auto-generated by Fern from our API Definition.
2008
+ */
2009
+
2010
+ type FeedbackPublic = FeedbackPublic.Numerical | FeedbackPublic.Categorical;
2011
+ declare namespace FeedbackPublic {
2012
+ interface Numerical extends NumericalFeedbackDefinitionPublic, _Base {
2013
+ type: "numerical";
2014
+ }
2015
+ interface Categorical extends CategoricalFeedbackDefinitionPublic, _Base {
2016
+ type: "categorical";
2017
+ }
2018
+ interface _Base {
2019
+ id?: string;
2020
+ name: string;
2021
+ createdAt?: Date;
2022
+ createdBy?: string;
2023
+ lastUpdatedAt?: Date;
2024
+ lastUpdatedBy?: string;
2025
+ }
2026
+ }
2027
+
2028
+ /**
2029
+ * This file was auto-generated by Fern from our API Definition.
2030
+ */
2031
+
2032
+ interface CategoricalFeedbackDefinitionUpdate {
2033
+ details?: CategoricalFeedbackDetailUpdate;
2034
+ }
2035
+
2036
+ /**
2037
+ * This file was auto-generated by Fern from our API Definition.
2038
+ */
2039
+ interface CategoricalFeedbackDetailUpdate {
2040
+ categories: Record<string, number>;
2041
+ }
2042
+
2043
+ /**
2044
+ * This file was auto-generated by Fern from our API Definition.
2045
+ */
2046
+
2047
+ type FeedbackUpdate = FeedbackUpdate.Numerical | FeedbackUpdate.Categorical;
2048
+ declare namespace FeedbackUpdate {
2049
+ interface Numerical extends NumericalFeedbackDefinitionUpdate, _Base {
2050
+ type: "numerical";
2051
+ }
2052
+ interface Categorical extends CategoricalFeedbackDefinitionUpdate, _Base {
2053
+ type: "categorical";
2054
+ }
2055
+ interface _Base {
2056
+ id?: string;
2057
+ name: string;
2058
+ }
2059
+ }
2060
+
2061
+ /**
2062
+ * This file was auto-generated by Fern from our API Definition.
2063
+ */
2064
+
2065
+ interface NumericalFeedbackDefinitionUpdate {
2066
+ details?: NumericalFeedbackDetailUpdate;
2067
+ }
2068
+
2069
+ /**
2070
+ * This file was auto-generated by Fern from our API Definition.
2071
+ */
2072
+ interface NumericalFeedbackDetailUpdate {
2073
+ max: number;
2074
+ min: number;
2075
+ }
2076
+
2077
+ /**
2078
+ * This file was auto-generated by Fern from our API Definition.
2079
+ */
2080
+
2081
+ interface ProjectPagePublic {
2082
+ page?: number;
2083
+ size?: number;
2084
+ total?: number;
2085
+ content?: ProjectPublic[];
2086
+ sortableBy?: string[];
2087
+ }
2088
+
2089
+ /**
2090
+ * This file was auto-generated by Fern from our API Definition.
2091
+ */
2092
+ type ProviderApiKeyPublicProvider = "openai" | "anthropic" | "gemini";
2093
+ declare const ProviderApiKeyPublicProvider: {
2094
+ readonly Openai: "openai";
2095
+ readonly Anthropic: "anthropic";
2096
+ readonly Gemini: "gemini";
2097
+ };
2098
+
2099
+ /**
2100
+ * This file was auto-generated by Fern from our API Definition.
2101
+ */
2102
+
2103
+ interface ProviderApiKeyPublic {
2104
+ id?: string;
2105
+ provider: ProviderApiKeyPublicProvider;
2106
+ apiKey: string;
2107
+ name?: string;
2108
+ createdAt?: Date;
2109
+ createdBy?: string;
2110
+ lastUpdatedAt?: Date;
2111
+ lastUpdatedBy?: string;
2112
+ }
2113
+
2114
+ /**
2115
+ * This file was auto-generated by Fern from our API Definition.
2116
+ */
2117
+ interface PercentageValues {
2118
+ p50?: number;
2119
+ p90?: number;
2120
+ p99?: number;
2121
+ }
2122
+
2123
+ /**
2124
+ * This file was auto-generated by Fern from our API Definition.
2125
+ */
2126
+ interface ProjectPublic {
2127
+ id?: string;
2128
+ name: string;
2129
+ description?: string;
2130
+ createdAt?: Date;
2131
+ createdBy?: string;
2132
+ lastUpdatedAt?: Date;
2133
+ lastUpdatedBy?: string;
2134
+ lastUpdatedTraceAt?: Date;
2135
+ }
2136
+
2137
+ /**
2138
+ * This file was auto-generated by Fern from our API Definition.
2139
+ */
2140
+
2141
+ interface FeedbackScoreNames {
2142
+ scores?: ScoreName[];
2143
+ }
2144
+
2145
+ /**
2146
+ * This file was auto-generated by Fern from our API Definition.
2147
+ */
2148
+ interface ScoreName {
2149
+ name?: string;
2150
+ }
2151
+
2152
+ /**
2153
+ * This file was auto-generated by Fern from our API Definition.
2154
+ */
2155
+ interface DataPointNumberPublic {
2156
+ time: Date;
2157
+ value?: number;
2158
+ }
2159
+
2160
+ /**
2161
+ * This file was auto-generated by Fern from our API Definition.
2162
+ */
2163
+ type ProjectMetricResponsePublicMetricType = "FEEDBACK_SCORES" | "TRACE_COUNT" | "TOKEN_USAGE" | "DURATION" | "COST";
2164
+ declare const ProjectMetricResponsePublicMetricType: {
2165
+ readonly FeedbackScores: "FEEDBACK_SCORES";
2166
+ readonly TraceCount: "TRACE_COUNT";
2167
+ readonly TokenUsage: "TOKEN_USAGE";
2168
+ readonly Duration: "DURATION";
2169
+ readonly Cost: "COST";
2170
+ };
2171
+
2172
+ /**
2173
+ * This file was auto-generated by Fern from our API Definition.
2174
+ */
2175
+ type ProjectMetricResponsePublicInterval = "HOURLY" | "DAILY" | "WEEKLY";
2176
+ declare const ProjectMetricResponsePublicInterval: {
2177
+ readonly Hourly: "HOURLY";
2178
+ readonly Daily: "DAILY";
2179
+ readonly Weekly: "WEEKLY";
2180
+ };
2181
+
2182
+ /**
2183
+ * This file was auto-generated by Fern from our API Definition.
2184
+ */
2185
+
2186
+ interface ProjectMetricResponsePublic {
2187
+ projectId?: string;
2188
+ metricType?: ProjectMetricResponsePublicMetricType;
2189
+ interval?: ProjectMetricResponsePublicInterval;
2190
+ results?: ResultsNumberPublic[];
2191
+ }
2192
+
2193
+ /**
2194
+ * This file was auto-generated by Fern from our API Definition.
2195
+ */
2196
+
2197
+ interface ResultsNumberPublic {
2198
+ name?: string;
2199
+ data?: DataPointNumberPublic[];
2200
+ }
2201
+
2202
+ /**
2203
+ * This file was auto-generated by Fern from our API Definition.
2204
+ */
2205
+
2206
+ interface ProjectStatsSummary {
2207
+ content?: ProjectStatsSummaryItem[];
2208
+ }
2209
+
2210
+ /**
2211
+ * This file was auto-generated by Fern from our API Definition.
2212
+ */
2213
+
2214
+ interface ProjectStatsSummaryItem {
2215
+ projectId?: string;
2216
+ feedbackScores?: FeedbackScoreAverage[];
2217
+ duration?: PercentageValues;
2218
+ totalEstimatedCost?: number;
2219
+ usage?: Record<string, number>;
2220
+ }
2221
+
2222
+ /**
2223
+ * This file was auto-generated by Fern from our API Definition.
2224
+ */
2225
+ interface FeedbackScoreAverageDetailed {
2226
+ name: string;
2227
+ value: number;
2228
+ }
2229
+
2230
+ /**
2231
+ * This file was auto-generated by Fern from our API Definition.
2232
+ */
2233
+ interface PercentageValuesDetailed {
2234
+ p50?: number;
2235
+ p90?: number;
2236
+ p99?: number;
2237
+ }
2238
+
2239
+ /**
2240
+ * This file was auto-generated by Fern from our API Definition.
2241
+ */
2242
+
2243
+ interface ProjectDetailed {
2244
+ id?: string;
2245
+ name: string;
2246
+ description?: string;
2247
+ createdAt?: Date;
2248
+ createdBy?: string;
2249
+ lastUpdatedAt?: Date;
2250
+ lastUpdatedBy?: string;
2251
+ lastUpdatedTraceAt?: Date;
2252
+ feedbackScores?: FeedbackScoreAverageDetailed[];
2253
+ duration?: PercentageValuesDetailed;
2254
+ totalEstimatedCost?: number;
2255
+ usage?: Record<string, number>;
2256
+ }
2257
+
2258
+ /**
2259
+ * This file was auto-generated by Fern from our API Definition.
2260
+ */
2261
+ type JsonNodeDetail = Record<string, unknown>;
2262
+
2263
+ /**
2264
+ * This file was auto-generated by Fern from our API Definition.
2265
+ */
2266
+ type PromptVersionDetailType = "mustache" | "jinja2";
2267
+ declare const PromptVersionDetailType: {
2268
+ readonly Mustache: "mustache";
2269
+ readonly Jinja2: "jinja2";
2270
+ };
2271
+
2272
+ /**
2273
+ * This file was auto-generated by Fern from our API Definition.
2274
+ */
2275
+
2276
+ interface PromptVersionDetail {
2277
+ /** version unique identifier, generated if absent */
2278
+ id?: string;
2279
+ promptId?: string;
2280
+ /** version short unique identifier, generated if absent. it must be 8 characters long */
2281
+ commit?: string;
2282
+ template: string;
2283
+ metadata?: JsonNodeDetail;
2284
+ type?: PromptVersionDetailType;
2285
+ changeDescription?: string;
2286
+ variables?: string[];
2287
+ createdAt?: Date;
2288
+ createdBy?: string;
2289
+ }
2290
+
2291
+ /**
2292
+ * This file was auto-generated by Fern from our API Definition.
2293
+ */
2294
+
2295
+ interface PromptDetail {
2296
+ id?: string;
2297
+ name: string;
2298
+ description?: string;
2299
+ createdAt?: Date;
2300
+ createdBy?: string;
2301
+ lastUpdatedAt?: Date;
2302
+ lastUpdatedBy?: string;
2303
+ versionCount?: number;
2304
+ latestVersion?: PromptVersionDetail;
2305
+ }
2306
+
2307
+ /**
2308
+ * This file was auto-generated by Fern from our API Definition.
2309
+ */
2310
+
2311
+ interface PromptVersionPagePublic {
2312
+ page?: number;
2313
+ size?: number;
2314
+ total?: number;
2315
+ content?: PromptVersionPublic[];
2316
+ }
2317
+
2318
+ /**
2319
+ * This file was auto-generated by Fern from our API Definition.
2320
+ */
2321
+ type PromptVersionPublicType = "mustache" | "jinja2";
2322
+ declare const PromptVersionPublicType: {
2323
+ readonly Mustache: "mustache";
2324
+ readonly Jinja2: "jinja2";
2325
+ };
2326
+
2327
+ /**
2328
+ * This file was auto-generated by Fern from our API Definition.
2329
+ */
2330
+
2331
+ interface PromptVersionPublic {
2332
+ /** version unique identifier, generated if absent */
2333
+ id?: string;
2334
+ promptId?: string;
2335
+ /** version short unique identifier, generated if absent. it must be 8 characters long */
2336
+ commit?: string;
2337
+ template: string;
2338
+ metadata?: JsonNodePublic;
2339
+ type?: PromptVersionPublicType;
2340
+ changeDescription?: string;
2341
+ createdAt?: Date;
2342
+ createdBy?: string;
2343
+ }
2344
+
2345
+ /**
2346
+ * This file was auto-generated by Fern from our API Definition.
2347
+ */
2348
+
2349
+ interface PromptPagePublic {
2350
+ page?: number;
2351
+ size?: number;
2352
+ total?: number;
2353
+ content?: PromptPublic[];
2354
+ }
2355
+
2356
+ /**
2357
+ * This file was auto-generated by Fern from our API Definition.
2358
+ */
2359
+ interface PromptPublic {
2360
+ id?: string;
2361
+ name: string;
2362
+ description?: string;
2363
+ createdAt?: Date;
2364
+ createdBy?: string;
2365
+ lastUpdatedAt?: Date;
2366
+ lastUpdatedBy?: string;
2367
+ versionCount?: number;
2368
+ }
2369
+
2370
+ /**
2371
+ * This file was auto-generated by Fern from our API Definition.
2372
+ */
2373
+ interface ErrorInfo {
2374
+ exceptionType: string;
2375
+ message?: string;
2376
+ traceback: string;
2377
+ }
2378
+
2379
+ /**
2380
+ * This file was auto-generated by Fern from our API Definition.
2381
+ */
2382
+ type SpanType = "general" | "tool" | "llm";
2383
+ declare const SpanType: {
2384
+ readonly General: "general";
2385
+ readonly Tool: "tool";
2386
+ readonly Llm: "llm";
2387
+ };
2388
+
2389
+ /**
2390
+ * This file was auto-generated by Fern from our API Definition.
2391
+ */
2392
+
2393
+ interface Span$1 {
2394
+ id?: string;
2395
+ /** If null, the default project is used */
2396
+ projectName?: string;
2397
+ projectId?: string;
2398
+ traceId: string;
2399
+ parentSpanId?: string;
2400
+ name: string;
2401
+ type: SpanType;
2402
+ startTime: Date;
2403
+ endTime?: Date;
2404
+ input?: JsonNode;
2405
+ output?: JsonNode;
2406
+ metadata?: JsonNode;
2407
+ model?: string;
2408
+ provider?: string;
2409
+ tags?: string[];
2410
+ usage?: Record<string, number>;
2411
+ errorInfo?: ErrorInfo;
2412
+ createdAt?: Date;
2413
+ lastUpdatedAt?: Date;
2414
+ createdBy?: string;
2415
+ lastUpdatedBy?: string;
2416
+ feedbackScores?: FeedbackScore[];
2417
+ comments?: Comment[];
2418
+ totalEstimatedCost?: number;
2419
+ totalEstimatedCostVersion?: string;
2420
+ /** Duration in milliseconds as a decimal number to support sub-millisecond precision */
2421
+ duration?: number;
2422
+ }
2423
+
2424
+ /**
2425
+ * This file was auto-generated by Fern from our API Definition.
2426
+ */
2427
+ interface ErrorInfoWrite {
2428
+ exceptionType: string;
2429
+ message?: string;
2430
+ traceback: string;
2431
+ }
2432
+
2433
+ /**
2434
+ * This file was auto-generated by Fern from our API Definition.
2435
+ */
2436
+ type SpanWriteType = "general" | "tool" | "llm";
2437
+ declare const SpanWriteType: {
2438
+ readonly General: "general";
2439
+ readonly Tool: "tool";
2440
+ readonly Llm: "llm";
2441
+ };
2442
+
2443
+ /**
2444
+ * This file was auto-generated by Fern from our API Definition.
2445
+ */
2446
+
2447
+ interface SpanWrite {
2448
+ id?: string;
2449
+ /** If null, the default project is used */
2450
+ projectName?: string;
2451
+ traceId: string;
2452
+ parentSpanId?: string;
2453
+ name: string;
2454
+ type: SpanWriteType;
2455
+ startTime: Date;
2456
+ endTime?: Date;
2457
+ input?: JsonNodeWrite;
2458
+ output?: JsonNodeWrite;
2459
+ metadata?: JsonNodeWrite;
2460
+ model?: string;
2461
+ provider?: string;
2462
+ tags?: string[];
2463
+ usage?: Record<string, number>;
2464
+ errorInfo?: ErrorInfoWrite;
2465
+ totalEstimatedCost?: number;
2466
+ totalEstimatedCostVersion?: string;
2467
+ }
2468
+
2469
+ /**
2470
+ * This file was auto-generated by Fern from our API Definition.
2471
+ */
2472
+ interface DeleteFeedbackScore {
2473
+ name: string;
2474
+ }
2475
+
2476
+ /**
2477
+ * This file was auto-generated by Fern from our API Definition.
2478
+ */
2479
+ interface ErrorInfoPublic {
2480
+ exceptionType: string;
2481
+ message?: string;
2482
+ traceback: string;
2483
+ }
2484
+
2485
+ /**
2486
+ * This file was auto-generated by Fern from our API Definition.
2487
+ */
2488
+ type FeedbackScorePublicSource = "ui" | "sdk" | "online_scoring";
2489
+ declare const FeedbackScorePublicSource: {
2490
+ readonly Ui: "ui";
2491
+ readonly Sdk: "sdk";
2492
+ readonly OnlineScoring: "online_scoring";
2493
+ };
2494
+
2495
+ /**
2496
+ * This file was auto-generated by Fern from our API Definition.
2497
+ */
2498
+
2499
+ interface FeedbackScorePublic {
2500
+ name: string;
2501
+ categoryName?: string;
2502
+ value: number;
2503
+ reason?: string;
2504
+ source: FeedbackScorePublicSource;
2505
+ createdAt?: Date;
2506
+ lastUpdatedAt?: Date;
2507
+ createdBy?: string;
2508
+ lastUpdatedBy?: string;
2509
+ }
2510
+
2511
+ /**
2512
+ * This file was auto-generated by Fern from our API Definition.
2513
+ */
2514
+ type SpanPublicType = "general" | "tool" | "llm";
2515
+ declare const SpanPublicType: {
2516
+ readonly General: "general";
2517
+ readonly Tool: "tool";
2518
+ readonly Llm: "llm";
2519
+ };
2520
+
2521
+ /**
2522
+ * This file was auto-generated by Fern from our API Definition.
2523
+ */
2524
+
2525
+ interface SpanPublic {
2526
+ id?: string;
2527
+ projectId?: string;
2528
+ traceId: string;
2529
+ parentSpanId?: string;
2530
+ name: string;
2531
+ type: SpanPublicType;
2532
+ startTime: Date;
2533
+ endTime?: Date;
2534
+ input?: JsonNodePublic;
2535
+ output?: JsonNodePublic;
2536
+ metadata?: JsonNodePublic;
2537
+ model?: string;
2538
+ provider?: string;
2539
+ tags?: string[];
2540
+ usage?: Record<string, number>;
2541
+ errorInfo?: ErrorInfoPublic;
2542
+ createdAt?: Date;
2543
+ lastUpdatedAt?: Date;
2544
+ createdBy?: string;
2545
+ lastUpdatedBy?: string;
2546
+ feedbackScores?: FeedbackScorePublic[];
2547
+ comments?: CommentPublic[];
2548
+ totalEstimatedCost?: number;
2549
+ totalEstimatedCostVersion?: string;
2550
+ /** Duration in milliseconds as a decimal number to support sub-millisecond precision */
2551
+ duration?: number;
2552
+ }
2553
+
2554
+ /**
2555
+ * This file was auto-generated by Fern from our API Definition.
2556
+ */
2557
+
2558
+ interface SpanPagePublic {
2559
+ page?: number;
2560
+ size?: number;
2561
+ total?: number;
2562
+ content?: SpanPublic[];
2563
+ }
2564
+
2565
+ /**
2566
+ * This file was auto-generated by Fern from our API Definition.
2567
+ */
2568
+ interface AvgValueStatPublic {
2569
+ value?: number;
2570
+ }
2571
+
2572
+ /**
2573
+ * This file was auto-generated by Fern from our API Definition.
2574
+ */
2575
+ interface CountValueStatPublic {
2576
+ value?: number;
2577
+ }
2578
+
2579
+ /**
2580
+ * This file was auto-generated by Fern from our API Definition.
2581
+ */
2582
+
2583
+ interface PercentageValueStatPublic {
2584
+ value?: PercentageValuesPublic;
2585
+ }
2586
+
2587
+ /**
2588
+ * This file was auto-generated by Fern from our API Definition.
2589
+ */
2590
+ interface PercentageValuesPublic {
2591
+ p50?: number;
2592
+ p90?: number;
2593
+ p99?: number;
2594
+ }
2595
+
2596
+ /**
2597
+ * This file was auto-generated by Fern from our API Definition.
2598
+ */
2599
+
2600
+ type ProjectStatItemObjectPublic = ProjectStatItemObjectPublic.Percentage | ProjectStatItemObjectPublic.Count | ProjectStatItemObjectPublic.Avg;
2601
+ declare namespace ProjectStatItemObjectPublic {
2602
+ interface Percentage extends PercentageValueStatPublic, _Base {
2603
+ type: "PERCENTAGE";
2604
+ }
2605
+ interface Count extends CountValueStatPublic, _Base {
2606
+ type: "COUNT";
2607
+ }
2608
+ interface Avg extends AvgValueStatPublic, _Base {
2609
+ type: "AVG";
2610
+ }
2611
+ interface _Base {
2612
+ name?: string;
2613
+ }
2614
+ }
2615
+
2616
+ /**
2617
+ * This file was auto-generated by Fern from our API Definition.
2618
+ */
2619
+
2620
+ interface ProjectStatsPublic {
2621
+ stats?: ProjectStatItemObjectPublic[];
2622
+ }
2623
+
2624
+ /**
2625
+ * This file was auto-generated by Fern from our API Definition.
2626
+ */
2627
+
2628
+ interface FeedbackScoreBatch {
2629
+ scores: FeedbackScoreBatchItem[];
2630
+ }
2631
+
2632
+ /**
2633
+ * This file was auto-generated by Fern from our API Definition.
2634
+ */
2635
+ type FeedbackScoreBatchItemSource = "ui" | "sdk" | "online_scoring";
2636
+ declare const FeedbackScoreBatchItemSource: {
2637
+ readonly Ui: "ui";
2638
+ readonly Sdk: "sdk";
2639
+ readonly OnlineScoring: "online_scoring";
2640
+ };
2641
+
2642
+ /**
2643
+ * This file was auto-generated by Fern from our API Definition.
2644
+ */
2645
+
2646
+ interface FeedbackScoreBatchItem {
2647
+ id: string;
2648
+ /** If null, the default project is used */
2649
+ projectName?: string;
2650
+ name: string;
2651
+ categoryName?: string;
2652
+ value: number;
2653
+ reason?: string;
2654
+ source: FeedbackScoreBatchItemSource;
2655
+ }
2656
+
2657
+ /**
2658
+ * This file was auto-generated by Fern from our API Definition.
2659
+ */
2660
+ type SpanFilterPublicOperator = "contains" | "not_contains" | "starts_with" | "ends_with" | "=" | "!=" | ">" | ">=" | "<" | "<=";
2661
+ declare const SpanFilterPublicOperator: {
2662
+ readonly Contains: "contains";
2663
+ readonly NotContains: "not_contains";
2664
+ readonly StartsWith: "starts_with";
2665
+ readonly EndsWith: "ends_with";
2666
+ readonly EqualTo: "=";
2667
+ readonly NotEquals: "!=";
2668
+ readonly GreaterThan: ">";
2669
+ readonly GreaterThanOrEqualTo: ">=";
2670
+ readonly LessThan: "<";
2671
+ readonly LessThanOrEqualTo: "<=";
2672
+ };
2673
+
2674
+ /**
2675
+ * This file was auto-generated by Fern from our API Definition.
2676
+ */
2677
+
2678
+ interface SpanFilterPublic {
2679
+ field?: string;
2680
+ operator?: SpanFilterPublicOperator;
2681
+ key?: string;
2682
+ value?: string;
2683
+ }
2684
+
2685
+ /**
2686
+ * This file was auto-generated by Fern from our API Definition.
2687
+ */
2688
+
2689
+ interface Trace$1 {
2690
+ id?: string;
2691
+ /** If null, the default project is used */
2692
+ projectName?: string;
2693
+ projectId?: string;
2694
+ name: string;
2695
+ startTime: Date;
2696
+ endTime?: Date;
2697
+ input?: JsonNode;
2698
+ output?: JsonNode;
2699
+ metadata?: JsonNode;
2700
+ tags?: string[];
2701
+ errorInfo?: ErrorInfo;
2702
+ usage?: Record<string, number>;
2703
+ createdAt?: Date;
2704
+ lastUpdatedAt?: Date;
2705
+ createdBy?: string;
2706
+ lastUpdatedBy?: string;
2707
+ feedbackScores?: FeedbackScore[];
2708
+ comments?: Comment[];
2709
+ totalEstimatedCost?: number;
2710
+ /** Duration in milliseconds as a decimal number to support sub-millisecond precision */
2711
+ duration?: number;
2712
+ }
2713
+
2714
+ /**
2715
+ * This file was auto-generated by Fern from our API Definition.
2716
+ */
2717
+
2718
+ interface TraceWrite {
2719
+ id?: string;
2720
+ /** If null, the default project is used */
2721
+ projectName?: string;
2722
+ name: string;
2723
+ startTime: Date;
2724
+ endTime?: Date;
2725
+ input?: JsonNodeWrite;
2726
+ output?: JsonNodeWrite;
2727
+ metadata?: JsonNodeWrite;
2728
+ tags?: string[];
2729
+ errorInfo?: ErrorInfoWrite;
2730
+ }
2731
+
2732
+ /**
2733
+ * This file was auto-generated by Fern from our API Definition.
2734
+ */
2735
+
2736
+ interface TracePublic {
2737
+ id?: string;
2738
+ projectId?: string;
2739
+ name: string;
2740
+ startTime: Date;
2741
+ endTime?: Date;
2742
+ input?: JsonNodePublic;
2743
+ output?: JsonNodePublic;
2744
+ metadata?: JsonNodePublic;
2745
+ tags?: string[];
2746
+ errorInfo?: ErrorInfoPublic;
2747
+ usage?: Record<string, number>;
2748
+ createdAt?: Date;
2749
+ lastUpdatedAt?: Date;
2750
+ createdBy?: string;
2751
+ lastUpdatedBy?: string;
2752
+ feedbackScores?: FeedbackScorePublic[];
2753
+ comments?: CommentPublic[];
2754
+ totalEstimatedCost?: number;
2755
+ /** Duration in milliseconds as a decimal number to support sub-millisecond precision */
2756
+ duration?: number;
2757
+ }
2758
+
2759
+ /**
2760
+ * This file was auto-generated by Fern from our API Definition.
2761
+ */
2762
+
2763
+ interface TracePagePublic {
2764
+ page?: number;
2765
+ size?: number;
2766
+ total?: number;
2767
+ content?: TracePublic[];
2768
+ }
2769
+
2770
+ /**
2771
+ * This file was auto-generated by Fern from our API Definition.
2772
+ */
2773
+ declare const OpikApiEnvironment: {
2774
+ readonly Default: "http://localhost:5173/api";
2775
+ };
2776
+ type OpikApiEnvironment = typeof OpikApiEnvironment.Default;
2777
+
2778
+ type Supplier<T> = T | Promise<T> | (() => T | Promise<T>);
2779
+ declare const Supplier: {
2780
+ get: <T>(supplier: Supplier<T>) => Promise<T>;
2781
+ };
2782
+
2783
+ /**
2784
+ * This file was auto-generated by Fern from our API Definition.
2785
+ */
2786
+
2787
+ declare namespace SystemUsage {
2788
+ interface Options {
2789
+ environment?: Supplier<OpikApiEnvironment | string>;
2790
+ /** Specify a custom URL to connect the client to. */
2791
+ baseUrl?: Supplier<string>;
2792
+ /** Override the Authorization header */
2793
+ apiKey?: Supplier<string | undefined>;
2794
+ /** Override the Comet-Workspace header */
2795
+ workspaceName?: Supplier<string | undefined>;
2796
+ }
2797
+ interface RequestOptions {
2798
+ /** The maximum time to wait for a response in seconds. */
2799
+ timeoutInSeconds?: number;
2800
+ /** The number of times to retry the request. Defaults to 2. */
2801
+ maxRetries?: number;
2802
+ /** A hook to abort the request. */
2803
+ abortSignal?: AbortSignal;
2804
+ /** Override the Authorization header */
2805
+ apiKey?: string | undefined;
2806
+ /** Override the Comet-Workspace header */
2807
+ workspaceName?: string | undefined;
2808
+ /** Additional headers to include in the request. */
2809
+ headers?: Record<string, string>;
2810
+ }
2811
+ }
2812
+ /**
2813
+ * System usage related resource
2814
+ */
2815
+ declare class SystemUsage {
2816
+ protected readonly _options: SystemUsage.Options;
2817
+ constructor(_options?: SystemUsage.Options);
2818
+ /**
2819
+ * Get datasets information for BI events per user per workspace
2820
+ *
2821
+ * @param {SystemUsage.RequestOptions} requestOptions - Request-specific configuration.
2822
+ *
2823
+ * @example
2824
+ * await client.systemUsage.getDatasetBiInfo()
2825
+ */
2826
+ getDatasetBiInfo(requestOptions?: SystemUsage.RequestOptions): Promise<BiInformationResponse>;
2827
+ /**
2828
+ * Get experiments information for BI events per user per workspace
2829
+ *
2830
+ * @param {SystemUsage.RequestOptions} requestOptions - Request-specific configuration.
2831
+ *
2832
+ * @example
2833
+ * await client.systemUsage.getExperimentBiInfo()
2834
+ */
2835
+ getExperimentBiInfo(requestOptions?: SystemUsage.RequestOptions): Promise<BiInformationResponse>;
2836
+ /**
2837
+ * Get traces information for BI events per user per workspace
2838
+ *
2839
+ * @param {SystemUsage.RequestOptions} requestOptions - Request-specific configuration.
2840
+ *
2841
+ * @example
2842
+ * await client.systemUsage.getTracesBiInfo()
2843
+ */
2844
+ getTracesBiInfo(requestOptions?: SystemUsage.RequestOptions): Promise<BiInformationResponse>;
2845
+ /**
2846
+ * Get traces count on previous day for all available workspaces
2847
+ *
2848
+ * @param {SystemUsage.RequestOptions} requestOptions - Request-specific configuration.
2849
+ *
2850
+ * @example
2851
+ * await client.systemUsage.getTracesCountForWorkspaces()
2852
+ */
2853
+ getTracesCountForWorkspaces(requestOptions?: SystemUsage.RequestOptions): Promise<TraceCountResponse>;
2854
+ protected _getCustomAuthorizationHeaders(): Promise<{
2855
+ Authorization: string | undefined;
2856
+ }>;
2857
+ }
2858
+
2859
+ /**
2860
+ * This file was auto-generated by Fern from our API Definition.
2861
+ */
2862
+
2863
+ declare namespace Check {
2864
+ interface Options {
2865
+ environment?: Supplier<OpikApiEnvironment | string>;
2866
+ /** Specify a custom URL to connect the client to. */
2867
+ baseUrl?: Supplier<string>;
2868
+ /** Override the Authorization header */
2869
+ apiKey?: Supplier<string | undefined>;
2870
+ /** Override the Comet-Workspace header */
2871
+ workspaceName?: Supplier<string | undefined>;
2872
+ }
2873
+ interface RequestOptions {
2874
+ /** The maximum time to wait for a response in seconds. */
2875
+ timeoutInSeconds?: number;
2876
+ /** The number of times to retry the request. Defaults to 2. */
2877
+ maxRetries?: number;
2878
+ /** A hook to abort the request. */
2879
+ abortSignal?: AbortSignal;
2880
+ /** Override the Authorization header */
2881
+ apiKey?: string | undefined;
2882
+ /** Override the Comet-Workspace header */
2883
+ workspaceName?: string | undefined;
2884
+ /** Additional headers to include in the request. */
2885
+ headers?: Record<string, string>;
2886
+ }
2887
+ }
2888
+ /**
2889
+ * Access check resources
2890
+ */
2891
+ declare class Check {
2892
+ protected readonly _options: Check.Options;
2893
+ constructor(_options?: Check.Options);
2894
+ /**
2895
+ * Check user access to workspace
2896
+ *
2897
+ * @param {OpikApi.AuthDetailsHolder} request
2898
+ * @param {Check.RequestOptions} requestOptions - Request-specific configuration.
2899
+ *
2900
+ * @throws {@link OpikApi.UnauthorizedError}
2901
+ * @throws {@link OpikApi.ForbiddenError}
2902
+ *
2903
+ * @example
2904
+ * await client.check.access({
2905
+ * "key": "value"
2906
+ * })
2907
+ */
2908
+ access(request: AuthDetailsHolder, requestOptions?: Check.RequestOptions): Promise<void>;
2909
+ protected _getCustomAuthorizationHeaders(): Promise<{
2910
+ Authorization: string | undefined;
2911
+ }>;
2912
+ }
2913
+
2914
+ /**
2915
+ * This file was auto-generated by Fern from our API Definition.
2916
+ */
2917
+
2918
+ declare namespace AutomationRuleEvaluators {
2919
+ interface Options {
2920
+ environment?: Supplier<OpikApiEnvironment | string>;
2921
+ /** Specify a custom URL to connect the client to. */
2922
+ baseUrl?: Supplier<string>;
2923
+ /** Override the Authorization header */
2924
+ apiKey?: Supplier<string | undefined>;
2925
+ /** Override the Comet-Workspace header */
2926
+ workspaceName?: Supplier<string | undefined>;
2927
+ }
2928
+ interface RequestOptions {
2929
+ /** The maximum time to wait for a response in seconds. */
2930
+ timeoutInSeconds?: number;
2931
+ /** The number of times to retry the request. Defaults to 2. */
2932
+ maxRetries?: number;
2933
+ /** A hook to abort the request. */
2934
+ abortSignal?: AbortSignal;
2935
+ /** Override the Authorization header */
2936
+ apiKey?: string | undefined;
2937
+ /** Override the Comet-Workspace header */
2938
+ workspaceName?: string | undefined;
2939
+ /** Additional headers to include in the request. */
2940
+ headers?: Record<string, string>;
2941
+ }
2942
+ }
2943
+ /**
2944
+ * Automation rule evaluators resource
2945
+ */
2946
+ declare class AutomationRuleEvaluators {
2947
+ protected readonly _options: AutomationRuleEvaluators.Options;
2948
+ constructor(_options?: AutomationRuleEvaluators.Options);
2949
+ /**
2950
+ * Find project Evaluators
2951
+ *
2952
+ * @param {OpikApi.FindEvaluatorsRequest} request
2953
+ * @param {AutomationRuleEvaluators.RequestOptions} requestOptions - Request-specific configuration.
2954
+ *
2955
+ * @example
2956
+ * await client.automationRuleEvaluators.findEvaluators()
2957
+ */
2958
+ findEvaluators(request?: FindEvaluatorsRequest, requestOptions?: AutomationRuleEvaluators.RequestOptions): Promise<AutomationRuleEvaluatorPagePublic>;
2959
+ /**
2960
+ * Create automation rule evaluator
2961
+ *
2962
+ * @param {OpikApi.AutomationRuleEvaluatorWrite} request
2963
+ * @param {AutomationRuleEvaluators.RequestOptions} requestOptions - Request-specific configuration.
2964
+ *
2965
+ * @example
2966
+ * await client.automationRuleEvaluators.createAutomationRuleEvaluator({
2967
+ * type: "llm_as_judge"
2968
+ * })
2969
+ */
2970
+ createAutomationRuleEvaluator(request: AutomationRuleEvaluatorWrite, requestOptions?: AutomationRuleEvaluators.RequestOptions): Promise<void>;
2971
+ /**
2972
+ * Delete automation rule evaluators batch
2973
+ *
2974
+ * @param {OpikApi.DeleteAutomationRuleEvaluatorBatchRequest} request
2975
+ * @param {AutomationRuleEvaluators.RequestOptions} requestOptions - Request-specific configuration.
2976
+ *
2977
+ * @example
2978
+ * await client.automationRuleEvaluators.deleteAutomationRuleEvaluatorBatch({
2979
+ * projectId: "project_id",
2980
+ * body: {
2981
+ * ids: ["ids"]
2982
+ * }
2983
+ * })
2984
+ */
2985
+ deleteAutomationRuleEvaluatorBatch(request: DeleteAutomationRuleEvaluatorBatchRequest, requestOptions?: AutomationRuleEvaluators.RequestOptions): Promise<void>;
2986
+ /**
2987
+ * Get automation rule by id
2988
+ *
2989
+ * @param {string} id
2990
+ * @param {OpikApi.GetEvaluatorByIdRequest} request
2991
+ * @param {AutomationRuleEvaluators.RequestOptions} requestOptions - Request-specific configuration.
2992
+ *
2993
+ * @example
2994
+ * await client.automationRuleEvaluators.getEvaluatorById("id")
2995
+ */
2996
+ getEvaluatorById(id: string, request?: GetEvaluatorByIdRequest, requestOptions?: AutomationRuleEvaluators.RequestOptions): Promise<AutomationRuleEvaluatorPublic>;
2997
+ /**
2998
+ * update Automation Rule Evaluator by id
2999
+ *
3000
+ * @param {string} id
3001
+ * @param {OpikApi.AutomationRuleEvaluatorUpdate} request
3002
+ * @param {AutomationRuleEvaluators.RequestOptions} requestOptions - Request-specific configuration.
3003
+ *
3004
+ * @example
3005
+ * await client.automationRuleEvaluators.updateAutomationRuleEvaluator("id", {
3006
+ * name: "name",
3007
+ * code: {
3008
+ * model: {
3009
+ * name: "name",
3010
+ * temperature: 1.1
3011
+ * },
3012
+ * messages: [{
3013
+ * role: "SYSTEM",
3014
+ * content: "content"
3015
+ * }],
3016
+ * variables: {
3017
+ * "key": "value"
3018
+ * },
3019
+ * schema: [{
3020
+ * name: "name",
3021
+ * type: "BOOLEAN",
3022
+ * description: "description"
3023
+ * }]
3024
+ * },
3025
+ * samplingRate: 1.1
3026
+ * })
3027
+ */
3028
+ updateAutomationRuleEvaluator(id: string, request: AutomationRuleEvaluatorUpdate, requestOptions?: AutomationRuleEvaluators.RequestOptions): Promise<void>;
3029
+ /**
3030
+ * Get automation rule evaluator logs by id
3031
+ *
3032
+ * @param {string} id
3033
+ * @param {OpikApi.GetEvaluatorLogsByIdRequest} request
3034
+ * @param {AutomationRuleEvaluators.RequestOptions} requestOptions - Request-specific configuration.
3035
+ *
3036
+ * @example
3037
+ * await client.automationRuleEvaluators.getEvaluatorLogsById("id")
3038
+ */
3039
+ getEvaluatorLogsById(id: string, request?: GetEvaluatorLogsByIdRequest, requestOptions?: AutomationRuleEvaluators.RequestOptions): Promise<LogPage>;
3040
+ /**
3041
+ * Find project Evaluators Deprecated
3042
+ *
3043
+ * @param {string} projectId
3044
+ * @param {OpikApi.FindEvaluatorsDeprecatedRequest} request
3045
+ * @param {AutomationRuleEvaluators.RequestOptions} requestOptions - Request-specific configuration.
3046
+ *
3047
+ * @example
3048
+ * await client.automationRuleEvaluators.findEvaluatorsDeprecated("projectId")
3049
+ */
3050
+ findEvaluatorsDeprecated(projectId: string, request?: FindEvaluatorsDeprecatedRequest, requestOptions?: AutomationRuleEvaluators.RequestOptions): Promise<AutomationRuleEvaluatorPagePublic>;
3051
+ /**
3052
+ * Create automation rule evaluator Deprecated
3053
+ *
3054
+ * @param {string} projectId
3055
+ * @param {OpikApi.AutomationRuleEvaluatorWrite} request
3056
+ * @param {AutomationRuleEvaluators.RequestOptions} requestOptions - Request-specific configuration.
3057
+ *
3058
+ * @example
3059
+ * await client.automationRuleEvaluators.createAutomationRuleEvaluatorDeprecated("projectId", {
3060
+ * type: "llm_as_judge"
3061
+ * })
3062
+ */
3063
+ createAutomationRuleEvaluatorDeprecated(projectId: string, request: AutomationRuleEvaluatorWrite, requestOptions?: AutomationRuleEvaluators.RequestOptions): Promise<void>;
3064
+ /**
3065
+ * Delete automation rule evaluators batch Deprecated
3066
+ *
3067
+ * @param {string} projectId
3068
+ * @param {OpikApi.BatchDelete} request
3069
+ * @param {AutomationRuleEvaluators.RequestOptions} requestOptions - Request-specific configuration.
3070
+ *
3071
+ * @example
3072
+ * await client.automationRuleEvaluators.deleteAutomationRuleEvaluatorBatchDeprecated("projectId", {
3073
+ * ids: ["ids"]
3074
+ * })
3075
+ */
3076
+ deleteAutomationRuleEvaluatorBatchDeprecated(projectId: string, request: BatchDelete, requestOptions?: AutomationRuleEvaluators.RequestOptions): Promise<void>;
3077
+ /**
3078
+ * Get automation rule by id Deprecated
3079
+ *
3080
+ * @param {string} projectId
3081
+ * @param {string} id
3082
+ * @param {AutomationRuleEvaluators.RequestOptions} requestOptions - Request-specific configuration.
3083
+ *
3084
+ * @example
3085
+ * await client.automationRuleEvaluators.getEvaluatorByIdDeprecated("projectId", "id")
3086
+ */
3087
+ getEvaluatorByIdDeprecated(projectId: string, id: string, requestOptions?: AutomationRuleEvaluators.RequestOptions): Promise<AutomationRuleEvaluatorPublic>;
3088
+ /**
3089
+ * update Automation Rule Evaluator by id Deprecated
3090
+ *
3091
+ * @param {string} id
3092
+ * @param {string} projectId
3093
+ * @param {OpikApi.AutomationRuleEvaluatorUpdate} request
3094
+ * @param {AutomationRuleEvaluators.RequestOptions} requestOptions - Request-specific configuration.
3095
+ *
3096
+ * @example
3097
+ * await client.automationRuleEvaluators.updateAutomationRuleEvaluatorDeprecated("id", "projectId", {
3098
+ * name: "name",
3099
+ * code: {
3100
+ * model: {
3101
+ * name: "name",
3102
+ * temperature: 1.1
3103
+ * },
3104
+ * messages: [{
3105
+ * role: "SYSTEM",
3106
+ * content: "content"
3107
+ * }],
3108
+ * variables: {
3109
+ * "key": "value"
3110
+ * },
3111
+ * schema: [{
3112
+ * name: "name",
3113
+ * type: "BOOLEAN",
3114
+ * description: "description"
3115
+ * }]
3116
+ * },
3117
+ * samplingRate: 1.1
3118
+ * })
3119
+ */
3120
+ updateAutomationRuleEvaluatorDeprecated(id: string, projectId: string, request: AutomationRuleEvaluatorUpdate, requestOptions?: AutomationRuleEvaluators.RequestOptions): Promise<void>;
3121
+ /**
3122
+ * Get automation rule evaluator logs by id Deprecated
3123
+ *
3124
+ * @param {string} projectId
3125
+ * @param {string} id
3126
+ * @param {OpikApi.GetEvaluatorLogsByIdDeprecatedRequest} request
3127
+ * @param {AutomationRuleEvaluators.RequestOptions} requestOptions - Request-specific configuration.
3128
+ *
3129
+ * @example
3130
+ * await client.automationRuleEvaluators.getEvaluatorLogsByIdDeprecated("projectId", "id")
3131
+ */
3132
+ getEvaluatorLogsByIdDeprecated(projectId: string, id: string, request?: GetEvaluatorLogsByIdDeprecatedRequest, requestOptions?: AutomationRuleEvaluators.RequestOptions): Promise<LogPage>;
3133
+ protected _getCustomAuthorizationHeaders(): Promise<{
3134
+ Authorization: string | undefined;
3135
+ }>;
3136
+ }
3137
+
3138
+ /**
3139
+ * This file was auto-generated by Fern from our API Definition.
3140
+ */
3141
+
3142
+ declare namespace ChatCompletions {
3143
+ interface Options {
3144
+ environment?: Supplier<OpikApiEnvironment | string>;
3145
+ /** Specify a custom URL to connect the client to. */
3146
+ baseUrl?: Supplier<string>;
3147
+ /** Override the Authorization header */
3148
+ apiKey?: Supplier<string | undefined>;
3149
+ /** Override the Comet-Workspace header */
3150
+ workspaceName?: Supplier<string | undefined>;
3151
+ }
3152
+ interface RequestOptions {
3153
+ /** The maximum time to wait for a response in seconds. */
3154
+ timeoutInSeconds?: number;
3155
+ /** The number of times to retry the request. Defaults to 2. */
3156
+ maxRetries?: number;
3157
+ /** A hook to abort the request. */
3158
+ abortSignal?: AbortSignal;
3159
+ /** Override the Authorization header */
3160
+ apiKey?: string | undefined;
3161
+ /** Override the Comet-Workspace header */
3162
+ workspaceName?: string | undefined;
3163
+ /** Additional headers to include in the request. */
3164
+ headers?: Record<string, string>;
3165
+ }
3166
+ }
3167
+ /**
3168
+ * Chat Completions related resources
3169
+ */
3170
+ declare class ChatCompletions {
3171
+ protected readonly _options: ChatCompletions.Options;
3172
+ constructor(_options?: ChatCompletions.Options);
3173
+ /**
3174
+ * Create chat completions
3175
+ *
3176
+ * @param {OpikApi.ChatCompletionRequest} request
3177
+ * @param {ChatCompletions.RequestOptions} requestOptions - Request-specific configuration.
3178
+ *
3179
+ * @example
3180
+ * await client.chatCompletions.createChatCompletions()
3181
+ */
3182
+ createChatCompletions(request?: ChatCompletionRequest, requestOptions?: ChatCompletions.RequestOptions): Promise<ChatCompletionResponse>;
3183
+ protected _getCustomAuthorizationHeaders(): Promise<{
3184
+ Authorization: string | undefined;
3185
+ }>;
3186
+ }
3187
+
3188
+ /**
3189
+ * This file was auto-generated by Fern from our API Definition.
3190
+ */
3191
+
3192
+ declare namespace Datasets {
3193
+ interface Options {
3194
+ environment?: Supplier<OpikApiEnvironment | string>;
3195
+ /** Specify a custom URL to connect the client to. */
3196
+ baseUrl?: Supplier<string>;
3197
+ /** Override the Authorization header */
3198
+ apiKey?: Supplier<string | undefined>;
3199
+ /** Override the Comet-Workspace header */
3200
+ workspaceName?: Supplier<string | undefined>;
3201
+ }
3202
+ interface RequestOptions {
3203
+ /** The maximum time to wait for a response in seconds. */
3204
+ timeoutInSeconds?: number;
3205
+ /** The number of times to retry the request. Defaults to 2. */
3206
+ maxRetries?: number;
3207
+ /** A hook to abort the request. */
3208
+ abortSignal?: AbortSignal;
3209
+ /** Override the Authorization header */
3210
+ apiKey?: string | undefined;
3211
+ /** Override the Comet-Workspace header */
3212
+ workspaceName?: string | undefined;
3213
+ /** Additional headers to include in the request. */
3214
+ headers?: Record<string, string>;
3215
+ }
3216
+ }
3217
+ /**
3218
+ * Dataset resources
3219
+ */
3220
+ declare class Datasets {
3221
+ protected readonly _options: Datasets.Options;
3222
+ constructor(_options?: Datasets.Options);
3223
+ /**
3224
+ * Find datasets
3225
+ *
3226
+ * @param {OpikApi.FindDatasetsRequest} request
3227
+ * @param {Datasets.RequestOptions} requestOptions - Request-specific configuration.
3228
+ *
3229
+ * @example
3230
+ * await client.datasets.findDatasets()
3231
+ */
3232
+ findDatasets(request?: FindDatasetsRequest, requestOptions?: Datasets.RequestOptions): Promise<DatasetPagePublic>;
3233
+ /**
3234
+ * Create dataset
3235
+ *
3236
+ * @param {OpikApi.DatasetWrite} request
3237
+ * @param {Datasets.RequestOptions} requestOptions - Request-specific configuration.
3238
+ *
3239
+ * @example
3240
+ * await client.datasets.createDataset({
3241
+ * name: "name"
3242
+ * })
3243
+ */
3244
+ createDataset(request: DatasetWrite, requestOptions?: Datasets.RequestOptions): Promise<void>;
3245
+ /**
3246
+ * Create/update dataset items based on dataset item id
3247
+ *
3248
+ * @param {OpikApi.DatasetItemBatchWrite} request
3249
+ * @param {Datasets.RequestOptions} requestOptions - Request-specific configuration.
3250
+ *
3251
+ * @example
3252
+ * await client.datasets.createOrUpdateDatasetItems({
3253
+ * items: [{
3254
+ * source: "manual",
3255
+ * data: {
3256
+ * "key": "value"
3257
+ * }
3258
+ * }]
3259
+ * })
3260
+ */
3261
+ createOrUpdateDatasetItems(request: DatasetItemBatchWrite, requestOptions?: Datasets.RequestOptions): Promise<void>;
3262
+ /**
3263
+ * Get dataset by id
3264
+ *
3265
+ * @param {string} id
3266
+ * @param {Datasets.RequestOptions} requestOptions - Request-specific configuration.
3267
+ *
3268
+ * @example
3269
+ * await client.datasets.getDatasetById("id")
3270
+ */
3271
+ getDatasetById(id: string, requestOptions?: Datasets.RequestOptions): Promise<DatasetPublic>;
3272
+ /**
3273
+ * Update dataset by id
3274
+ *
3275
+ * @param {string} id
3276
+ * @param {OpikApi.DatasetUpdate} request
3277
+ * @param {Datasets.RequestOptions} requestOptions - Request-specific configuration.
3278
+ *
3279
+ * @example
3280
+ * await client.datasets.updateDataset("id", {
3281
+ * name: "name"
3282
+ * })
3283
+ */
3284
+ updateDataset(id: string, request: DatasetUpdate, requestOptions?: Datasets.RequestOptions): Promise<void>;
3285
+ /**
3286
+ * Delete dataset by id
3287
+ *
3288
+ * @param {string} id
3289
+ * @param {Datasets.RequestOptions} requestOptions - Request-specific configuration.
3290
+ *
3291
+ * @example
3292
+ * await client.datasets.deleteDataset("id")
3293
+ */
3294
+ deleteDataset(id: string, requestOptions?: Datasets.RequestOptions): Promise<void>;
3295
+ /**
3296
+ * Delete dataset by name
3297
+ *
3298
+ * @param {OpikApi.DatasetIdentifier} request
3299
+ * @param {Datasets.RequestOptions} requestOptions - Request-specific configuration.
3300
+ *
3301
+ * @example
3302
+ * await client.datasets.deleteDatasetByName({
3303
+ * datasetName: "dataset_name"
3304
+ * })
3305
+ */
3306
+ deleteDatasetByName(request: DatasetIdentifier, requestOptions?: Datasets.RequestOptions): Promise<void>;
3307
+ /**
3308
+ * Delete dataset items
3309
+ *
3310
+ * @param {OpikApi.DatasetItemsDelete} request
3311
+ * @param {Datasets.RequestOptions} requestOptions - Request-specific configuration.
3312
+ *
3313
+ * @example
3314
+ * await client.datasets.deleteDatasetItems({
3315
+ * itemIds: ["item_ids"]
3316
+ * })
3317
+ */
3318
+ deleteDatasetItems(request: DatasetItemsDelete, requestOptions?: Datasets.RequestOptions): Promise<void>;
3319
+ /**
3320
+ * Delete datasets batch
3321
+ *
3322
+ * @param {OpikApi.BatchDelete} request
3323
+ * @param {Datasets.RequestOptions} requestOptions - Request-specific configuration.
3324
+ *
3325
+ * @example
3326
+ * await client.datasets.deleteDatasetsBatch({
3327
+ * ids: ["ids"]
3328
+ * })
3329
+ */
3330
+ deleteDatasetsBatch(request: BatchDelete, requestOptions?: Datasets.RequestOptions): Promise<void>;
3331
+ /**
3332
+ * Find dataset items with experiment items
3333
+ *
3334
+ * @param {string} id
3335
+ * @param {OpikApi.FindDatasetItemsWithExperimentItemsRequest} request
3336
+ * @param {Datasets.RequestOptions} requestOptions - Request-specific configuration.
3337
+ *
3338
+ * @example
3339
+ * await client.datasets.findDatasetItemsWithExperimentItems("id", {
3340
+ * experimentIds: "experiment_ids"
3341
+ * })
3342
+ */
3343
+ findDatasetItemsWithExperimentItems(id: string, request: FindDatasetItemsWithExperimentItemsRequest, requestOptions?: Datasets.RequestOptions): Promise<DatasetItemPageCompare>;
3344
+ /**
3345
+ * Get dataset by name
3346
+ *
3347
+ * @param {OpikApi.DatasetIdentifierPublic} request
3348
+ * @param {Datasets.RequestOptions} requestOptions - Request-specific configuration.
3349
+ *
3350
+ * @example
3351
+ * await client.datasets.getDatasetByIdentifier({
3352
+ * datasetName: "dataset_name"
3353
+ * })
3354
+ */
3355
+ getDatasetByIdentifier(request: DatasetIdentifierPublic, requestOptions?: Datasets.RequestOptions): Promise<DatasetPublic>;
3356
+ /**
3357
+ * Get dataset item by id
3358
+ *
3359
+ * @param {string} itemId
3360
+ * @param {Datasets.RequestOptions} requestOptions - Request-specific configuration.
3361
+ *
3362
+ * @example
3363
+ * await client.datasets.getDatasetItemById("itemId")
3364
+ */
3365
+ getDatasetItemById(itemId: string, requestOptions?: Datasets.RequestOptions): Promise<DatasetItemPublic>;
3366
+ /**
3367
+ * Get dataset items
3368
+ *
3369
+ * @param {string} id
3370
+ * @param {OpikApi.GetDatasetItemsRequest} request
3371
+ * @param {Datasets.RequestOptions} requestOptions - Request-specific configuration.
3372
+ *
3373
+ * @example
3374
+ * await client.datasets.getDatasetItems("id")
3375
+ */
3376
+ getDatasetItems(id: string, request?: GetDatasetItemsRequest, requestOptions?: Datasets.RequestOptions): Promise<DatasetItemPagePublic>;
3377
+ /**
3378
+ * Get dataset items output columns
3379
+ *
3380
+ * @param {string} id
3381
+ * @param {OpikApi.GetDatasetItemsOutputColumnsRequest} request
3382
+ * @param {Datasets.RequestOptions} requestOptions - Request-specific configuration.
3383
+ *
3384
+ * @example
3385
+ * await client.datasets.getDatasetItemsOutputColumns("id")
3386
+ */
3387
+ getDatasetItemsOutputColumns(id: string, request?: GetDatasetItemsOutputColumnsRequest, requestOptions?: Datasets.RequestOptions): Promise<PageColumns>;
3388
+ /**
3389
+ * Stream dataset items
3390
+ */
3391
+ streamDatasetItems(request: DatasetItemStreamRequest, requestOptions?: Datasets.RequestOptions): Promise<stream.Readable>;
3392
+ protected _getCustomAuthorizationHeaders(): Promise<{
3393
+ Authorization: string | undefined;
3394
+ }>;
3395
+ }
3396
+
3397
+ /**
3398
+ * This file was auto-generated by Fern from our API Definition.
3399
+ */
3400
+
3401
+ declare namespace Experiments {
3402
+ interface Options {
3403
+ environment?: Supplier<OpikApiEnvironment | string>;
3404
+ /** Specify a custom URL to connect the client to. */
3405
+ baseUrl?: Supplier<string>;
3406
+ /** Override the Authorization header */
3407
+ apiKey?: Supplier<string | undefined>;
3408
+ /** Override the Comet-Workspace header */
3409
+ workspaceName?: Supplier<string | undefined>;
3410
+ }
3411
+ interface RequestOptions {
3412
+ /** The maximum time to wait for a response in seconds. */
3413
+ timeoutInSeconds?: number;
3414
+ /** The number of times to retry the request. Defaults to 2. */
3415
+ maxRetries?: number;
3416
+ /** A hook to abort the request. */
3417
+ abortSignal?: AbortSignal;
3418
+ /** Override the Authorization header */
3419
+ apiKey?: string | undefined;
3420
+ /** Override the Comet-Workspace header */
3421
+ workspaceName?: string | undefined;
3422
+ /** Additional headers to include in the request. */
3423
+ headers?: Record<string, string>;
3424
+ }
3425
+ }
3426
+ /**
3427
+ * Experiment resources
3428
+ */
3429
+ declare class Experiments {
3430
+ protected readonly _options: Experiments.Options;
3431
+ constructor(_options?: Experiments.Options);
3432
+ /**
3433
+ * Find experiments
3434
+ *
3435
+ * @param {OpikApi.FindExperimentsRequest} request
3436
+ * @param {Experiments.RequestOptions} requestOptions - Request-specific configuration.
3437
+ *
3438
+ * @example
3439
+ * await client.experiments.findExperiments()
3440
+ */
3441
+ findExperiments(request?: FindExperimentsRequest, requestOptions?: Experiments.RequestOptions): Promise<ExperimentPagePublic>;
3442
+ /**
3443
+ * Create experiment
3444
+ *
3445
+ * @param {OpikApi.ExperimentWrite} request
3446
+ * @param {Experiments.RequestOptions} requestOptions - Request-specific configuration.
3447
+ *
3448
+ * @example
3449
+ * await client.experiments.createExperiment({
3450
+ * datasetName: "dataset_name"
3451
+ * })
3452
+ */
3453
+ createExperiment(request: ExperimentWrite, requestOptions?: Experiments.RequestOptions): Promise<void>;
3454
+ /**
3455
+ * Create experiment items
3456
+ *
3457
+ * @param {OpikApi.ExperimentItemsBatch} request
3458
+ * @param {Experiments.RequestOptions} requestOptions - Request-specific configuration.
3459
+ *
3460
+ * @example
3461
+ * await client.experiments.createExperimentItems({
3462
+ * experimentItems: [{
3463
+ * experimentId: "experiment_id",
3464
+ * datasetItemId: "dataset_item_id",
3465
+ * traceId: "trace_id"
3466
+ * }]
3467
+ * })
3468
+ */
3469
+ createExperimentItems(request: ExperimentItemsBatch, requestOptions?: Experiments.RequestOptions): Promise<void>;
3470
+ /**
3471
+ * Delete experiment items
3472
+ *
3473
+ * @param {OpikApi.ExperimentItemsDelete} request
3474
+ * @param {Experiments.RequestOptions} requestOptions - Request-specific configuration.
3475
+ *
3476
+ * @example
3477
+ * await client.experiments.deleteExperimentItems({
3478
+ * ids: ["ids"]
3479
+ * })
3480
+ */
3481
+ deleteExperimentItems(request: ExperimentItemsDelete, requestOptions?: Experiments.RequestOptions): Promise<void>;
3482
+ /**
3483
+ * Delete experiments by id
3484
+ *
3485
+ * @param {OpikApi.ExperimentsDelete} request
3486
+ * @param {Experiments.RequestOptions} requestOptions - Request-specific configuration.
3487
+ *
3488
+ * @example
3489
+ * await client.experiments.deleteExperimentsById({
3490
+ * ids: ["ids"]
3491
+ * })
3492
+ */
3493
+ deleteExperimentsById(request: ExperimentsDelete, requestOptions?: Experiments.RequestOptions): Promise<void>;
3494
+ /**
3495
+ * Find Feedback Score names
3496
+ *
3497
+ * @param {OpikApi.FindFeedbackScoreNamesRequest} request
3498
+ * @param {Experiments.RequestOptions} requestOptions - Request-specific configuration.
3499
+ *
3500
+ * @example
3501
+ * await client.experiments.findFeedbackScoreNames()
3502
+ */
3503
+ findFeedbackScoreNames(request?: FindFeedbackScoreNamesRequest, requestOptions?: Experiments.RequestOptions): Promise<string[]>;
3504
+ /**
3505
+ * Get experiment by id
3506
+ *
3507
+ * @param {string} id
3508
+ * @param {Experiments.RequestOptions} requestOptions - Request-specific configuration.
3509
+ *
3510
+ * @throws {@link OpikApi.NotFoundError}
3511
+ *
3512
+ * @example
3513
+ * await client.experiments.getExperimentById("id")
3514
+ */
3515
+ getExperimentById(id: string, requestOptions?: Experiments.RequestOptions): Promise<ExperimentPublic>;
3516
+ /**
3517
+ * Get experiment by name
3518
+ *
3519
+ * @param {OpikApi.IdentifierPublic} request
3520
+ * @param {Experiments.RequestOptions} requestOptions - Request-specific configuration.
3521
+ *
3522
+ * @throws {@link OpikApi.NotFoundError}
3523
+ *
3524
+ * @example
3525
+ * await client.experiments.getExperimentByName({
3526
+ * name: "name"
3527
+ * })
3528
+ */
3529
+ getExperimentByName(request: IdentifierPublic, requestOptions?: Experiments.RequestOptions): Promise<ExperimentPublic>;
3530
+ /**
3531
+ * Get experiment item by id
3532
+ *
3533
+ * @param {string} id
3534
+ * @param {Experiments.RequestOptions} requestOptions - Request-specific configuration.
3535
+ *
3536
+ * @throws {@link OpikApi.NotFoundError}
3537
+ *
3538
+ * @example
3539
+ * await client.experiments.getExperimentItemById("id")
3540
+ */
3541
+ getExperimentItemById(id: string, requestOptions?: Experiments.RequestOptions): Promise<ExperimentItemPublic>;
3542
+ /**
3543
+ * Stream experiment items
3544
+ */
3545
+ streamExperimentItems(request: ExperimentItemStreamRequest, requestOptions?: Experiments.RequestOptions): Promise<stream.Readable>;
3546
+ protected _getCustomAuthorizationHeaders(): Promise<{
3547
+ Authorization: string | undefined;
3548
+ }>;
3549
+ }
3550
+
3551
+ /**
3552
+ * This file was auto-generated by Fern from our API Definition.
3553
+ */
3554
+
3555
+ declare namespace FeedbackDefinitions {
3556
+ interface Options {
3557
+ environment?: Supplier<OpikApiEnvironment | string>;
3558
+ /** Specify a custom URL to connect the client to. */
3559
+ baseUrl?: Supplier<string>;
3560
+ /** Override the Authorization header */
3561
+ apiKey?: Supplier<string | undefined>;
3562
+ /** Override the Comet-Workspace header */
3563
+ workspaceName?: Supplier<string | undefined>;
3564
+ }
3565
+ interface RequestOptions {
3566
+ /** The maximum time to wait for a response in seconds. */
3567
+ timeoutInSeconds?: number;
3568
+ /** The number of times to retry the request. Defaults to 2. */
3569
+ maxRetries?: number;
3570
+ /** A hook to abort the request. */
3571
+ abortSignal?: AbortSignal;
3572
+ /** Override the Authorization header */
3573
+ apiKey?: string | undefined;
3574
+ /** Override the Comet-Workspace header */
3575
+ workspaceName?: string | undefined;
3576
+ /** Additional headers to include in the request. */
3577
+ headers?: Record<string, string>;
3578
+ }
3579
+ }
3580
+ /**
3581
+ * Feedback definitions related resources
3582
+ */
3583
+ declare class FeedbackDefinitions {
3584
+ protected readonly _options: FeedbackDefinitions.Options;
3585
+ constructor(_options?: FeedbackDefinitions.Options);
3586
+ /**
3587
+ * Find Feedback definitions
3588
+ *
3589
+ * @param {OpikApi.FindFeedbackDefinitionsRequest} request
3590
+ * @param {FeedbackDefinitions.RequestOptions} requestOptions - Request-specific configuration.
3591
+ *
3592
+ * @example
3593
+ * await client.feedbackDefinitions.findFeedbackDefinitions()
3594
+ */
3595
+ findFeedbackDefinitions(request?: FindFeedbackDefinitionsRequest, requestOptions?: FeedbackDefinitions.RequestOptions): Promise<FeedbackDefinitionPagePublic>;
3596
+ /**
3597
+ * Get feedback definition
3598
+ *
3599
+ * @param {OpikApi.FeedbackCreate} request
3600
+ * @param {FeedbackDefinitions.RequestOptions} requestOptions - Request-specific configuration.
3601
+ *
3602
+ * @example
3603
+ * await client.feedbackDefinitions.createFeedbackDefinition({
3604
+ * type: "categorical"
3605
+ * })
3606
+ */
3607
+ createFeedbackDefinition(request: FeedbackCreate, requestOptions?: FeedbackDefinitions.RequestOptions): Promise<void>;
3608
+ /**
3609
+ * Get feedback definition by id
3610
+ *
3611
+ * @param {string} id
3612
+ * @param {FeedbackDefinitions.RequestOptions} requestOptions - Request-specific configuration.
3613
+ *
3614
+ * @example
3615
+ * await client.feedbackDefinitions.getFeedbackDefinitionById("id")
3616
+ */
3617
+ getFeedbackDefinitionById(id: string, requestOptions?: FeedbackDefinitions.RequestOptions): Promise<FeedbackPublic>;
3618
+ /**
3619
+ * Update feedback definition by id
3620
+ *
3621
+ * @param {string} id
3622
+ * @param {OpikApi.FeedbackUpdate} request
3623
+ * @param {FeedbackDefinitions.RequestOptions} requestOptions - Request-specific configuration.
3624
+ *
3625
+ * @example
3626
+ * await client.feedbackDefinitions.updateFeedbackDefinition("id", {
3627
+ * type: "categorical"
3628
+ * })
3629
+ */
3630
+ updateFeedbackDefinition(id: string, request: FeedbackUpdate, requestOptions?: FeedbackDefinitions.RequestOptions): Promise<void>;
3631
+ /**
3632
+ * Delete feedback definition by id
3633
+ *
3634
+ * @param {string} id
3635
+ * @param {FeedbackDefinitions.RequestOptions} requestOptions - Request-specific configuration.
3636
+ *
3637
+ * @example
3638
+ * await client.feedbackDefinitions.deleteFeedbackDefinitionById("id")
3639
+ */
3640
+ deleteFeedbackDefinitionById(id: string, requestOptions?: FeedbackDefinitions.RequestOptions): Promise<void>;
3641
+ /**
3642
+ * Delete feedback definitions batch
3643
+ *
3644
+ * @param {OpikApi.BatchDelete} request
3645
+ * @param {FeedbackDefinitions.RequestOptions} requestOptions - Request-specific configuration.
3646
+ *
3647
+ * @example
3648
+ * await client.feedbackDefinitions.deleteFeedbackDefinitionsBatch({
3649
+ * ids: ["ids"]
3650
+ * })
3651
+ */
3652
+ deleteFeedbackDefinitionsBatch(request: BatchDelete, requestOptions?: FeedbackDefinitions.RequestOptions): Promise<void>;
3653
+ protected _getCustomAuthorizationHeaders(): Promise<{
3654
+ Authorization: string | undefined;
3655
+ }>;
3656
+ }
3657
+
3658
+ /**
3659
+ * This file was auto-generated by Fern from our API Definition.
3660
+ */
3661
+
3662
+ declare namespace LlmProviderKey {
3663
+ interface Options {
3664
+ environment?: Supplier<OpikApiEnvironment | string>;
3665
+ /** Specify a custom URL to connect the client to. */
3666
+ baseUrl?: Supplier<string>;
3667
+ /** Override the Authorization header */
3668
+ apiKey?: Supplier<string | undefined>;
3669
+ /** Override the Comet-Workspace header */
3670
+ workspaceName?: Supplier<string | undefined>;
3671
+ }
3672
+ interface RequestOptions {
3673
+ /** The maximum time to wait for a response in seconds. */
3674
+ timeoutInSeconds?: number;
3675
+ /** The number of times to retry the request. Defaults to 2. */
3676
+ maxRetries?: number;
3677
+ /** A hook to abort the request. */
3678
+ abortSignal?: AbortSignal;
3679
+ /** Override the Authorization header */
3680
+ apiKey?: string | undefined;
3681
+ /** Override the Comet-Workspace header */
3682
+ workspaceName?: string | undefined;
3683
+ /** Additional headers to include in the request. */
3684
+ headers?: Record<string, string>;
3685
+ }
3686
+ }
3687
+ /**
3688
+ * LLM Provider Key
3689
+ */
3690
+ declare class LlmProviderKey {
3691
+ protected readonly _options: LlmProviderKey.Options;
3692
+ constructor(_options?: LlmProviderKey.Options);
3693
+ /**
3694
+ * Delete LLM Provider's ApiKeys batch
3695
+ *
3696
+ * @param {OpikApi.BatchDelete} request
3697
+ * @param {LlmProviderKey.RequestOptions} requestOptions - Request-specific configuration.
3698
+ *
3699
+ * @example
3700
+ * await client.llmProviderKey.deleteLlmProviderApiKeysBatch({
3701
+ * ids: ["ids"]
3702
+ * })
3703
+ */
3704
+ deleteLlmProviderApiKeysBatch(request: BatchDelete, requestOptions?: LlmProviderKey.RequestOptions): Promise<void>;
3705
+ /**
3706
+ * Find LLM Provider's ApiKeys
3707
+ *
3708
+ * @param {LlmProviderKey.RequestOptions} requestOptions - Request-specific configuration.
3709
+ *
3710
+ * @example
3711
+ * await client.llmProviderKey.findLlmProviderKeys()
3712
+ */
3713
+ findLlmProviderKeys(requestOptions?: LlmProviderKey.RequestOptions): Promise<ProjectPagePublic>;
3714
+ /**
3715
+ * Store LLM Provider's ApiKey
3716
+ *
3717
+ * @param {OpikApi.ProviderApiKeyWrite} request
3718
+ * @param {LlmProviderKey.RequestOptions} requestOptions - Request-specific configuration.
3719
+ *
3720
+ * @throws {@link OpikApi.UnauthorizedError}
3721
+ * @throws {@link OpikApi.ForbiddenError}
3722
+ *
3723
+ * @example
3724
+ * await client.llmProviderKey.storeLlmProviderApiKey({
3725
+ * provider: "openai",
3726
+ * apiKey: "api_key"
3727
+ * })
3728
+ */
3729
+ storeLlmProviderApiKey(request: ProviderApiKeyWrite, requestOptions?: LlmProviderKey.RequestOptions): Promise<void>;
3730
+ /**
3731
+ * Get LLM Provider's ApiKey by id
3732
+ *
3733
+ * @param {string} id
3734
+ * @param {LlmProviderKey.RequestOptions} requestOptions - Request-specific configuration.
3735
+ *
3736
+ * @throws {@link OpikApi.NotFoundError}
3737
+ *
3738
+ * @example
3739
+ * await client.llmProviderKey.getLlmProviderApiKeyById("id")
3740
+ */
3741
+ getLlmProviderApiKeyById(id: string, requestOptions?: LlmProviderKey.RequestOptions): Promise<ProviderApiKeyPublic>;
3742
+ /**
3743
+ * Update LLM Provider's ApiKey
3744
+ *
3745
+ * @param {string} id
3746
+ * @param {OpikApi.ProviderApiKeyUpdate} request
3747
+ * @param {LlmProviderKey.RequestOptions} requestOptions - Request-specific configuration.
3748
+ *
3749
+ * @throws {@link OpikApi.UnauthorizedError}
3750
+ * @throws {@link OpikApi.ForbiddenError}
3751
+ * @throws {@link OpikApi.NotFoundError}
3752
+ *
3753
+ * @example
3754
+ * await client.llmProviderKey.updateLlmProviderApiKey("id", {
3755
+ * apiKey: "api_key"
3756
+ * })
3757
+ */
3758
+ updateLlmProviderApiKey(id: string, request: ProviderApiKeyUpdate, requestOptions?: LlmProviderKey.RequestOptions): Promise<void>;
3759
+ protected _getCustomAuthorizationHeaders(): Promise<{
3760
+ Authorization: string | undefined;
3761
+ }>;
3762
+ }
3763
+
3764
+ /**
3765
+ * This file was auto-generated by Fern from our API Definition.
3766
+ */
3767
+
3768
+ declare namespace Projects {
3769
+ interface Options {
3770
+ environment?: Supplier<OpikApiEnvironment | string>;
3771
+ /** Specify a custom URL to connect the client to. */
3772
+ baseUrl?: Supplier<string>;
3773
+ /** Override the Authorization header */
3774
+ apiKey?: Supplier<string | undefined>;
3775
+ /** Override the Comet-Workspace header */
3776
+ workspaceName?: Supplier<string | undefined>;
3777
+ }
3778
+ interface RequestOptions {
3779
+ /** The maximum time to wait for a response in seconds. */
3780
+ timeoutInSeconds?: number;
3781
+ /** The number of times to retry the request. Defaults to 2. */
3782
+ maxRetries?: number;
3783
+ /** A hook to abort the request. */
3784
+ abortSignal?: AbortSignal;
3785
+ /** Override the Authorization header */
3786
+ apiKey?: string | undefined;
3787
+ /** Override the Comet-Workspace header */
3788
+ workspaceName?: string | undefined;
3789
+ /** Additional headers to include in the request. */
3790
+ headers?: Record<string, string>;
3791
+ }
3792
+ }
3793
+ /**
3794
+ * Project related resources
3795
+ */
3796
+ declare class Projects {
3797
+ protected readonly _options: Projects.Options;
3798
+ constructor(_options?: Projects.Options);
3799
+ /**
3800
+ * Find projects
3801
+ *
3802
+ * @param {OpikApi.FindProjectsRequest} request
3803
+ * @param {Projects.RequestOptions} requestOptions - Request-specific configuration.
3804
+ *
3805
+ * @example
3806
+ * await client.projects.findProjects()
3807
+ */
3808
+ findProjects(request?: FindProjectsRequest, requestOptions?: Projects.RequestOptions): Promise<ProjectPagePublic>;
3809
+ /**
3810
+ * Create project
3811
+ *
3812
+ * @param {OpikApi.ProjectWrite} request
3813
+ * @param {Projects.RequestOptions} requestOptions - Request-specific configuration.
3814
+ *
3815
+ * @throws {@link OpikApi.BadRequestError}
3816
+ * @throws {@link OpikApi.UnprocessableEntityError}
3817
+ *
3818
+ * @example
3819
+ * await client.projects.createProject({
3820
+ * name: "name"
3821
+ * })
3822
+ */
3823
+ createProject(request: ProjectWrite, requestOptions?: Projects.RequestOptions): Promise<void>;
3824
+ /**
3825
+ * Get project by id
3826
+ *
3827
+ * @param {string} id
3828
+ * @param {Projects.RequestOptions} requestOptions - Request-specific configuration.
3829
+ *
3830
+ * @example
3831
+ * await client.projects.getProjectById("id")
3832
+ */
3833
+ getProjectById(id: string, requestOptions?: Projects.RequestOptions): Promise<ProjectPublic>;
3834
+ /**
3835
+ * Delete project by id
3836
+ *
3837
+ * @param {string} id
3838
+ * @param {Projects.RequestOptions} requestOptions - Request-specific configuration.
3839
+ *
3840
+ * @throws {@link OpikApi.ConflictError}
3841
+ *
3842
+ * @example
3843
+ * await client.projects.deleteProjectById("id")
3844
+ */
3845
+ deleteProjectById(id: string, requestOptions?: Projects.RequestOptions): Promise<void>;
3846
+ /**
3847
+ * Update project by id
3848
+ *
3849
+ * @param {string} id
3850
+ * @param {OpikApi.ProjectUpdate} request
3851
+ * @param {Projects.RequestOptions} requestOptions - Request-specific configuration.
3852
+ *
3853
+ * @throws {@link OpikApi.BadRequestError}
3854
+ * @throws {@link OpikApi.UnprocessableEntityError}
3855
+ *
3856
+ * @example
3857
+ * await client.projects.updateProject("id")
3858
+ */
3859
+ updateProject(id: string, request?: ProjectUpdate, requestOptions?: Projects.RequestOptions): Promise<void>;
3860
+ /**
3861
+ * Delete projects batch
3862
+ *
3863
+ * @param {OpikApi.BatchDelete} request
3864
+ * @param {Projects.RequestOptions} requestOptions - Request-specific configuration.
3865
+ *
3866
+ * @example
3867
+ * await client.projects.deleteProjectsBatch({
3868
+ * ids: ["ids"]
3869
+ * })
3870
+ */
3871
+ deleteProjectsBatch(request: BatchDelete, requestOptions?: Projects.RequestOptions): Promise<void>;
3872
+ /**
3873
+ * Find Feedback Score names By Project Ids
3874
+ *
3875
+ * @param {OpikApi.FindFeedbackScoreNamesByProjectIdsRequest} request
3876
+ * @param {Projects.RequestOptions} requestOptions - Request-specific configuration.
3877
+ *
3878
+ * @example
3879
+ * await client.projects.findFeedbackScoreNamesByProjectIds()
3880
+ */
3881
+ findFeedbackScoreNamesByProjectIds(request?: FindFeedbackScoreNamesByProjectIdsRequest, requestOptions?: Projects.RequestOptions): Promise<FeedbackScoreNames>;
3882
+ /**
3883
+ * Gets specified metrics for a project
3884
+ *
3885
+ * @param {string} id
3886
+ * @param {OpikApi.ProjectMetricRequestPublic} request
3887
+ * @param {Projects.RequestOptions} requestOptions - Request-specific configuration.
3888
+ *
3889
+ * @throws {@link OpikApi.BadRequestError}
3890
+ * @throws {@link OpikApi.NotFoundError}
3891
+ *
3892
+ * @example
3893
+ * await client.projects.getProjectMetrics("id")
3894
+ */
3895
+ getProjectMetrics(id: string, request?: ProjectMetricRequestPublic, requestOptions?: Projects.RequestOptions): Promise<ProjectMetricResponsePublic>;
3896
+ /**
3897
+ * Get Project Stats
3898
+ *
3899
+ * @param {OpikApi.GetProjectStatsRequest} request
3900
+ * @param {Projects.RequestOptions} requestOptions - Request-specific configuration.
3901
+ *
3902
+ * @example
3903
+ * await client.projects.getProjectStats()
3904
+ */
3905
+ getProjectStats(request?: GetProjectStatsRequest, requestOptions?: Projects.RequestOptions): Promise<ProjectStatsSummary>;
3906
+ /**
3907
+ * Retrieve project
3908
+ *
3909
+ * @param {OpikApi.ProjectRetrieveDetailed} request
3910
+ * @param {Projects.RequestOptions} requestOptions - Request-specific configuration.
3911
+ *
3912
+ * @throws {@link OpikApi.BadRequestError}
3913
+ * @throws {@link OpikApi.NotFoundError}
3914
+ * @throws {@link OpikApi.UnprocessableEntityError}
3915
+ *
3916
+ * @example
3917
+ * await client.projects.retrieveProject({
3918
+ * name: "name"
3919
+ * })
3920
+ */
3921
+ retrieveProject(request: ProjectRetrieveDetailed, requestOptions?: Projects.RequestOptions): Promise<ProjectDetailed>;
3922
+ protected _getCustomAuthorizationHeaders(): Promise<{
3923
+ Authorization: string | undefined;
3924
+ }>;
3925
+ }
3926
+
3927
+ /**
3928
+ * This file was auto-generated by Fern from our API Definition.
3929
+ */
3930
+
3931
+ declare namespace Prompts {
3932
+ interface Options {
3933
+ environment?: Supplier<OpikApiEnvironment | string>;
3934
+ /** Specify a custom URL to connect the client to. */
3935
+ baseUrl?: Supplier<string>;
3936
+ /** Override the Authorization header */
3937
+ apiKey?: Supplier<string | undefined>;
3938
+ /** Override the Comet-Workspace header */
3939
+ workspaceName?: Supplier<string | undefined>;
3940
+ }
3941
+ interface RequestOptions {
3942
+ /** The maximum time to wait for a response in seconds. */
3943
+ timeoutInSeconds?: number;
3944
+ /** The number of times to retry the request. Defaults to 2. */
3945
+ maxRetries?: number;
3946
+ /** A hook to abort the request. */
3947
+ abortSignal?: AbortSignal;
3948
+ /** Override the Authorization header */
3949
+ apiKey?: string | undefined;
3950
+ /** Override the Comet-Workspace header */
3951
+ workspaceName?: string | undefined;
3952
+ /** Additional headers to include in the request. */
3953
+ headers?: Record<string, string>;
3954
+ }
3955
+ }
3956
+ /**
3957
+ * Prompt resources
3958
+ */
3959
+ declare class Prompts {
3960
+ protected readonly _options: Prompts.Options;
3961
+ constructor(_options?: Prompts.Options);
3962
+ /**
3963
+ * Get prompts
3964
+ *
3965
+ * @param {OpikApi.GetPromptsRequest} request
3966
+ * @param {Prompts.RequestOptions} requestOptions - Request-specific configuration.
3967
+ *
3968
+ * @example
3969
+ * await client.prompts.getPrompts()
3970
+ */
3971
+ getPrompts(request?: GetPromptsRequest, requestOptions?: Prompts.RequestOptions): Promise<PromptPagePublic>;
3972
+ /**
3973
+ * Create prompt
3974
+ *
3975
+ * @param {OpikApi.PromptWrite} request
3976
+ * @param {Prompts.RequestOptions} requestOptions - Request-specific configuration.
3977
+ *
3978
+ * @throws {@link OpikApi.BadRequestError}
3979
+ * @throws {@link OpikApi.ConflictError}
3980
+ * @throws {@link OpikApi.UnprocessableEntityError}
3981
+ *
3982
+ * @example
3983
+ * await client.prompts.createPrompt({
3984
+ * name: "name"
3985
+ * })
3986
+ */
3987
+ createPrompt(request: PromptWrite, requestOptions?: Prompts.RequestOptions): Promise<void>;
3988
+ /**
3989
+ * Create prompt version
3990
+ *
3991
+ * @param {OpikApi.CreatePromptVersionDetail} request
3992
+ * @param {Prompts.RequestOptions} requestOptions - Request-specific configuration.
3993
+ *
3994
+ * @throws {@link OpikApi.BadRequestError}
3995
+ * @throws {@link OpikApi.ConflictError}
3996
+ * @throws {@link OpikApi.UnprocessableEntityError}
3997
+ *
3998
+ * @example
3999
+ * await client.prompts.createPromptVersion({
4000
+ * name: "name",
4001
+ * version: {
4002
+ * template: "template"
4003
+ * }
4004
+ * })
4005
+ */
4006
+ createPromptVersion(request: CreatePromptVersionDetail, requestOptions?: Prompts.RequestOptions): Promise<PromptVersionDetail>;
4007
+ /**
4008
+ * Get prompt by id
4009
+ *
4010
+ * @param {string} id
4011
+ * @param {Prompts.RequestOptions} requestOptions - Request-specific configuration.
4012
+ *
4013
+ * @throws {@link OpikApi.NotFoundError}
4014
+ *
4015
+ * @example
4016
+ * await client.prompts.getPromptById("id")
4017
+ */
4018
+ getPromptById(id: string, requestOptions?: Prompts.RequestOptions): Promise<PromptDetail>;
4019
+ /**
4020
+ * Update prompt
4021
+ *
4022
+ * @param {string} id
4023
+ * @param {OpikApi.PromptUpdatable} request
4024
+ * @param {Prompts.RequestOptions} requestOptions - Request-specific configuration.
4025
+ *
4026
+ * @throws {@link OpikApi.BadRequestError}
4027
+ * @throws {@link OpikApi.NotFoundError}
4028
+ * @throws {@link OpikApi.ConflictError}
4029
+ * @throws {@link OpikApi.UnprocessableEntityError}
4030
+ *
4031
+ * @example
4032
+ * await client.prompts.updatePrompt("id", {
4033
+ * name: "name"
4034
+ * })
4035
+ */
4036
+ updatePrompt(id: string, request: PromptUpdatable, requestOptions?: Prompts.RequestOptions): Promise<void>;
4037
+ /**
4038
+ * Delete prompt
4039
+ *
4040
+ * @param {string} id
4041
+ * @param {Prompts.RequestOptions} requestOptions - Request-specific configuration.
4042
+ *
4043
+ * @example
4044
+ * await client.prompts.deletePrompt("id")
4045
+ */
4046
+ deletePrompt(id: string, requestOptions?: Prompts.RequestOptions): Promise<void>;
4047
+ /**
4048
+ * Delete prompts batch
4049
+ *
4050
+ * @param {OpikApi.BatchDelete} request
4051
+ * @param {Prompts.RequestOptions} requestOptions - Request-specific configuration.
4052
+ *
4053
+ * @example
4054
+ * await client.prompts.deletePromptsBatch({
4055
+ * ids: ["ids"]
4056
+ * })
4057
+ */
4058
+ deletePromptsBatch(request: BatchDelete, requestOptions?: Prompts.RequestOptions): Promise<void>;
4059
+ /**
4060
+ * Get prompt version by id
4061
+ *
4062
+ * @param {string} versionId
4063
+ * @param {Prompts.RequestOptions} requestOptions - Request-specific configuration.
4064
+ *
4065
+ * @throws {@link OpikApi.NotFoundError}
4066
+ *
4067
+ * @example
4068
+ * await client.prompts.getPromptVersionById("versionId")
4069
+ */
4070
+ getPromptVersionById(versionId: string, requestOptions?: Prompts.RequestOptions): Promise<PromptVersionDetail>;
4071
+ /**
4072
+ * Get prompt versions
4073
+ *
4074
+ * @param {string} id
4075
+ * @param {OpikApi.GetPromptVersionsRequest} request
4076
+ * @param {Prompts.RequestOptions} requestOptions - Request-specific configuration.
4077
+ *
4078
+ * @example
4079
+ * await client.prompts.getPromptVersions("id")
4080
+ */
4081
+ getPromptVersions(id: string, request?: GetPromptVersionsRequest, requestOptions?: Prompts.RequestOptions): Promise<PromptVersionPagePublic>;
4082
+ /**
4083
+ * Retrieve prompt version
4084
+ *
4085
+ * @param {OpikApi.PromptVersionRetrieveDetail} request
4086
+ * @param {Prompts.RequestOptions} requestOptions - Request-specific configuration.
4087
+ *
4088
+ * @throws {@link OpikApi.BadRequestError}
4089
+ * @throws {@link OpikApi.NotFoundError}
4090
+ * @throws {@link OpikApi.UnprocessableEntityError}
4091
+ *
4092
+ * @example
4093
+ * await client.prompts.retrievePromptVersion({
4094
+ * name: "name"
4095
+ * })
4096
+ */
4097
+ retrievePromptVersion(request: PromptVersionRetrieveDetail, requestOptions?: Prompts.RequestOptions): Promise<PromptVersionDetail>;
4098
+ protected _getCustomAuthorizationHeaders(): Promise<{
4099
+ Authorization: string | undefined;
4100
+ }>;
4101
+ }
4102
+
4103
+ /**
4104
+ * This file was auto-generated by Fern from our API Definition.
4105
+ */
4106
+
4107
+ declare namespace Spans {
4108
+ interface Options {
4109
+ environment?: Supplier<OpikApiEnvironment | string>;
4110
+ /** Specify a custom URL to connect the client to. */
4111
+ baseUrl?: Supplier<string>;
4112
+ /** Override the Authorization header */
4113
+ apiKey?: Supplier<string | undefined>;
4114
+ /** Override the Comet-Workspace header */
4115
+ workspaceName?: Supplier<string | undefined>;
4116
+ }
4117
+ interface RequestOptions {
4118
+ /** The maximum time to wait for a response in seconds. */
4119
+ timeoutInSeconds?: number;
4120
+ /** The number of times to retry the request. Defaults to 2. */
4121
+ maxRetries?: number;
4122
+ /** A hook to abort the request. */
4123
+ abortSignal?: AbortSignal;
4124
+ /** Override the Authorization header */
4125
+ apiKey?: string | undefined;
4126
+ /** Override the Comet-Workspace header */
4127
+ workspaceName?: string | undefined;
4128
+ /** Additional headers to include in the request. */
4129
+ headers?: Record<string, string>;
4130
+ }
4131
+ }
4132
+ /**
4133
+ * Span related resources
4134
+ */
4135
+ declare class Spans {
4136
+ protected readonly _options: Spans.Options;
4137
+ constructor(_options?: Spans.Options);
4138
+ /**
4139
+ * Add span comment
4140
+ *
4141
+ * @param {string} id
4142
+ * @param {OpikApi.Comment} request
4143
+ * @param {Spans.RequestOptions} requestOptions - Request-specific configuration.
4144
+ *
4145
+ * @example
4146
+ * await client.spans.addSpanComment("id", {
4147
+ * text: "text"
4148
+ * })
4149
+ */
4150
+ addSpanComment(id: string, request: Comment, requestOptions?: Spans.RequestOptions): Promise<void>;
4151
+ /**
4152
+ * Add span feedback score
4153
+ *
4154
+ * @param {string} id
4155
+ * @param {OpikApi.FeedbackScore} request
4156
+ * @param {Spans.RequestOptions} requestOptions - Request-specific configuration.
4157
+ *
4158
+ * @example
4159
+ * await client.spans.addSpanFeedbackScore("id", {
4160
+ * name: "name",
4161
+ * value: 1.1,
4162
+ * source: "ui"
4163
+ * })
4164
+ */
4165
+ addSpanFeedbackScore(id: string, request: FeedbackScore, requestOptions?: Spans.RequestOptions): Promise<void>;
4166
+ /**
4167
+ * Get spans by project_name or project_id and optionally by trace_id and/or type
4168
+ *
4169
+ * @param {OpikApi.GetSpansByProjectRequest} request
4170
+ * @param {Spans.RequestOptions} requestOptions - Request-specific configuration.
4171
+ *
4172
+ * @example
4173
+ * await client.spans.getSpansByProject()
4174
+ */
4175
+ getSpansByProject(request?: GetSpansByProjectRequest, requestOptions?: Spans.RequestOptions): Promise<SpanPagePublic>;
4176
+ /**
4177
+ * Create span
4178
+ *
4179
+ * @param {OpikApi.SpanWrite} request
4180
+ * @param {Spans.RequestOptions} requestOptions - Request-specific configuration.
4181
+ *
4182
+ * @example
4183
+ * await client.spans.createSpan({
4184
+ * traceId: "trace_id",
4185
+ * name: "name",
4186
+ * type: "general",
4187
+ * startTime: "2024-01-15T09:30:00Z"
4188
+ * })
4189
+ */
4190
+ createSpan(request: SpanWrite, requestOptions?: Spans.RequestOptions): Promise<void>;
4191
+ /**
4192
+ * Create spans
4193
+ *
4194
+ * @param {OpikApi.SpanBatchWrite} request
4195
+ * @param {Spans.RequestOptions} requestOptions - Request-specific configuration.
4196
+ *
4197
+ * @example
4198
+ * await client.spans.createSpans({
4199
+ * spans: [{
4200
+ * traceId: "trace_id",
4201
+ * name: "name",
4202
+ * type: "general",
4203
+ * startTime: "2024-01-15T09:30:00Z"
4204
+ * }]
4205
+ * })
4206
+ */
4207
+ createSpans(request: SpanBatchWrite, requestOptions?: Spans.RequestOptions): Promise<void>;
4208
+ /**
4209
+ * Get span by id
4210
+ *
4211
+ * @param {string} id
4212
+ * @param {Spans.RequestOptions} requestOptions - Request-specific configuration.
4213
+ *
4214
+ * @throws {@link OpikApi.NotFoundError}
4215
+ *
4216
+ * @example
4217
+ * await client.spans.getSpanById("id")
4218
+ */
4219
+ getSpanById(id: string, requestOptions?: Spans.RequestOptions): Promise<SpanPublic>;
4220
+ /**
4221
+ * Delete span by id
4222
+ *
4223
+ * @param {string} id
4224
+ * @param {Spans.RequestOptions} requestOptions - Request-specific configuration.
4225
+ *
4226
+ * @throws {@link OpikApi.NotImplementedError}
4227
+ *
4228
+ * @example
4229
+ * await client.spans.deleteSpanById("id")
4230
+ */
4231
+ deleteSpanById(id: string, requestOptions?: Spans.RequestOptions): Promise<void>;
4232
+ /**
4233
+ * Update span by id
4234
+ *
4235
+ * @param {string} id
4236
+ * @param {OpikApi.SpanUpdate} request
4237
+ * @param {Spans.RequestOptions} requestOptions - Request-specific configuration.
4238
+ *
4239
+ * @throws {@link OpikApi.NotFoundError}
4240
+ *
4241
+ * @example
4242
+ * await client.spans.updateSpan("id", {
4243
+ * traceId: "trace_id"
4244
+ * })
4245
+ */
4246
+ updateSpan(id: string, request: SpanUpdate$1, requestOptions?: Spans.RequestOptions): Promise<void>;
4247
+ /**
4248
+ * Delete span comments
4249
+ *
4250
+ * @param {OpikApi.BatchDelete} request
4251
+ * @param {Spans.RequestOptions} requestOptions - Request-specific configuration.
4252
+ *
4253
+ * @example
4254
+ * await client.spans.deleteSpanComments({
4255
+ * ids: ["ids"]
4256
+ * })
4257
+ */
4258
+ deleteSpanComments(request: BatchDelete, requestOptions?: Spans.RequestOptions): Promise<void>;
4259
+ /**
4260
+ * Delete span feedback score
4261
+ *
4262
+ * @param {string} id
4263
+ * @param {OpikApi.DeleteFeedbackScore} request
4264
+ * @param {Spans.RequestOptions} requestOptions - Request-specific configuration.
4265
+ *
4266
+ * @example
4267
+ * await client.spans.deleteSpanFeedbackScore("id", {
4268
+ * name: "name"
4269
+ * })
4270
+ */
4271
+ deleteSpanFeedbackScore(id: string, request: DeleteFeedbackScore, requestOptions?: Spans.RequestOptions): Promise<void>;
4272
+ /**
4273
+ * Find Feedback Score names
4274
+ *
4275
+ * @param {OpikApi.FindFeedbackScoreNames1Request} request
4276
+ * @param {Spans.RequestOptions} requestOptions - Request-specific configuration.
4277
+ *
4278
+ * @example
4279
+ * await client.spans.findFeedbackScoreNames1()
4280
+ */
4281
+ findFeedbackScoreNames1(request?: FindFeedbackScoreNames1Request, requestOptions?: Spans.RequestOptions): Promise<string[]>;
4282
+ /**
4283
+ * Get span comment
4284
+ *
4285
+ * @param {string} commentId
4286
+ * @param {string} spanId
4287
+ * @param {Spans.RequestOptions} requestOptions - Request-specific configuration.
4288
+ *
4289
+ * @throws {@link OpikApi.NotFoundError}
4290
+ *
4291
+ * @example
4292
+ * await client.spans.getSpanComment("commentId", "spanId")
4293
+ */
4294
+ getSpanComment(commentId: string, spanId: string, requestOptions?: Spans.RequestOptions): Promise<Comment>;
4295
+ /**
4296
+ * Get span stats
4297
+ *
4298
+ * @param {OpikApi.GetSpanStatsRequest} request
4299
+ * @param {Spans.RequestOptions} requestOptions - Request-specific configuration.
4300
+ *
4301
+ * @example
4302
+ * await client.spans.getSpanStats()
4303
+ */
4304
+ getSpanStats(request?: GetSpanStatsRequest, requestOptions?: Spans.RequestOptions): Promise<ProjectStatsPublic>;
4305
+ /**
4306
+ * Batch feedback scoring for spans
4307
+ *
4308
+ * @param {OpikApi.FeedbackScoreBatch} request
4309
+ * @param {Spans.RequestOptions} requestOptions - Request-specific configuration.
4310
+ *
4311
+ * @example
4312
+ * await client.spans.scoreBatchOfSpans({
4313
+ * scores: [{
4314
+ * id: "id",
4315
+ * name: "name",
4316
+ * value: 1.1,
4317
+ * source: "ui"
4318
+ * }]
4319
+ * })
4320
+ */
4321
+ scoreBatchOfSpans(request: FeedbackScoreBatch, requestOptions?: Spans.RequestOptions): Promise<void>;
4322
+ /**
4323
+ * Search spans
4324
+ * @throws {@link OpikApi.BadRequestError}
4325
+ */
4326
+ searchSpans(request?: SpanSearchStreamRequestPublic, requestOptions?: Spans.RequestOptions): Promise<stream.Readable>;
4327
+ /**
4328
+ * Update span comment by id
4329
+ *
4330
+ * @param {string} commentId
4331
+ * @param {OpikApi.Comment} request
4332
+ * @param {Spans.RequestOptions} requestOptions - Request-specific configuration.
4333
+ *
4334
+ * @throws {@link OpikApi.NotFoundError}
4335
+ *
4336
+ * @example
4337
+ * await client.spans.updateSpanComment("commentId", {
4338
+ * text: "text"
4339
+ * })
4340
+ */
4341
+ updateSpanComment(commentId: string, request: Comment, requestOptions?: Spans.RequestOptions): Promise<void>;
4342
+ protected _getCustomAuthorizationHeaders(): Promise<{
4343
+ Authorization: string | undefined;
4344
+ }>;
4345
+ }
4346
+
4347
+ /**
4348
+ * This file was auto-generated by Fern from our API Definition.
4349
+ */
4350
+
4351
+ declare namespace Traces {
4352
+ interface Options {
4353
+ environment?: Supplier<OpikApiEnvironment | string>;
4354
+ /** Specify a custom URL to connect the client to. */
4355
+ baseUrl?: Supplier<string>;
4356
+ /** Override the Authorization header */
4357
+ apiKey?: Supplier<string | undefined>;
4358
+ /** Override the Comet-Workspace header */
4359
+ workspaceName?: Supplier<string | undefined>;
4360
+ }
4361
+ interface RequestOptions {
4362
+ /** The maximum time to wait for a response in seconds. */
4363
+ timeoutInSeconds?: number;
4364
+ /** The number of times to retry the request. Defaults to 2. */
4365
+ maxRetries?: number;
4366
+ /** A hook to abort the request. */
4367
+ abortSignal?: AbortSignal;
4368
+ /** Override the Authorization header */
4369
+ apiKey?: string | undefined;
4370
+ /** Override the Comet-Workspace header */
4371
+ workspaceName?: string | undefined;
4372
+ /** Additional headers to include in the request. */
4373
+ headers?: Record<string, string>;
4374
+ }
4375
+ }
4376
+ /**
4377
+ * Trace related resources
4378
+ */
4379
+ declare class Traces {
4380
+ protected readonly _options: Traces.Options;
4381
+ constructor(_options?: Traces.Options);
4382
+ /**
4383
+ * Add trace comment
4384
+ *
4385
+ * @param {string} id
4386
+ * @param {OpikApi.Comment} request
4387
+ * @param {Traces.RequestOptions} requestOptions - Request-specific configuration.
4388
+ *
4389
+ * @example
4390
+ * await client.traces.addTraceComment("id", {
4391
+ * text: "text"
4392
+ * })
4393
+ */
4394
+ addTraceComment(id: string, request: Comment, requestOptions?: Traces.RequestOptions): Promise<void>;
4395
+ /**
4396
+ * Add trace feedback score
4397
+ *
4398
+ * @param {string} id
4399
+ * @param {OpikApi.FeedbackScore} request
4400
+ * @param {Traces.RequestOptions} requestOptions - Request-specific configuration.
4401
+ *
4402
+ * @example
4403
+ * await client.traces.addTraceFeedbackScore("id", {
4404
+ * name: "name",
4405
+ * value: 1.1,
4406
+ * source: "ui"
4407
+ * })
4408
+ */
4409
+ addTraceFeedbackScore(id: string, request: FeedbackScore, requestOptions?: Traces.RequestOptions): Promise<void>;
4410
+ /**
4411
+ * Get traces by project_name or project_id
4412
+ *
4413
+ * @param {OpikApi.GetTracesByProjectRequest} request
4414
+ * @param {Traces.RequestOptions} requestOptions - Request-specific configuration.
4415
+ *
4416
+ * @example
4417
+ * await client.traces.getTracesByProject()
4418
+ */
4419
+ getTracesByProject(request?: GetTracesByProjectRequest, requestOptions?: Traces.RequestOptions): Promise<TracePagePublic>;
4420
+ /**
4421
+ * Get trace
4422
+ *
4423
+ * @param {OpikApi.TraceWrite} request
4424
+ * @param {Traces.RequestOptions} requestOptions - Request-specific configuration.
4425
+ *
4426
+ * @example
4427
+ * await client.traces.createTrace({
4428
+ * name: "name",
4429
+ * startTime: "2024-01-15T09:30:00Z"
4430
+ * })
4431
+ */
4432
+ createTrace(request: TraceWrite, requestOptions?: Traces.RequestOptions): Promise<void>;
4433
+ /**
4434
+ * Create traces
4435
+ *
4436
+ * @param {OpikApi.TraceBatchWrite} request
4437
+ * @param {Traces.RequestOptions} requestOptions - Request-specific configuration.
4438
+ *
4439
+ * @example
4440
+ * await client.traces.createTraces({
4441
+ * traces: [{
4442
+ * name: "name",
4443
+ * startTime: "2024-01-15T09:30:00Z"
4444
+ * }]
4445
+ * })
4446
+ */
4447
+ createTraces(request: TraceBatchWrite, requestOptions?: Traces.RequestOptions): Promise<void>;
4448
+ /**
4449
+ * Get trace by id
4450
+ *
4451
+ * @param {string} id
4452
+ * @param {Traces.RequestOptions} requestOptions - Request-specific configuration.
4453
+ *
4454
+ * @example
4455
+ * await client.traces.getTraceById("id")
4456
+ */
4457
+ getTraceById(id: string, requestOptions?: Traces.RequestOptions): Promise<TracePublic>;
4458
+ /**
4459
+ * Delete trace by id
4460
+ *
4461
+ * @param {string} id
4462
+ * @param {Traces.RequestOptions} requestOptions - Request-specific configuration.
4463
+ *
4464
+ * @example
4465
+ * await client.traces.deleteTraceById("id")
4466
+ */
4467
+ deleteTraceById(id: string, requestOptions?: Traces.RequestOptions): Promise<void>;
4468
+ /**
4469
+ * Update trace by id
4470
+ *
4471
+ * @param {string} id
4472
+ * @param {OpikApi.TraceUpdate} request
4473
+ * @param {Traces.RequestOptions} requestOptions - Request-specific configuration.
4474
+ *
4475
+ * @example
4476
+ * await client.traces.updateTrace("id")
4477
+ */
4478
+ updateTrace(id: string, request?: TraceUpdate, requestOptions?: Traces.RequestOptions): Promise<void>;
4479
+ /**
4480
+ * Delete trace comments
4481
+ *
4482
+ * @param {OpikApi.BatchDelete} request
4483
+ * @param {Traces.RequestOptions} requestOptions - Request-specific configuration.
4484
+ *
4485
+ * @example
4486
+ * await client.traces.deleteTraceComments({
4487
+ * ids: ["ids"]
4488
+ * })
4489
+ */
4490
+ deleteTraceComments(request: BatchDelete, requestOptions?: Traces.RequestOptions): Promise<void>;
4491
+ /**
4492
+ * Delete trace feedback score
4493
+ *
4494
+ * @param {string} id
4495
+ * @param {OpikApi.DeleteFeedbackScore} request
4496
+ * @param {Traces.RequestOptions} requestOptions - Request-specific configuration.
4497
+ *
4498
+ * @example
4499
+ * await client.traces.deleteTraceFeedbackScore("id", {
4500
+ * name: "name"
4501
+ * })
4502
+ */
4503
+ deleteTraceFeedbackScore(id: string, request: DeleteFeedbackScore, requestOptions?: Traces.RequestOptions): Promise<void>;
4504
+ /**
4505
+ * Delete traces
4506
+ *
4507
+ * @param {OpikApi.BatchDelete} request
4508
+ * @param {Traces.RequestOptions} requestOptions - Request-specific configuration.
4509
+ *
4510
+ * @example
4511
+ * await client.traces.deleteTraces({
4512
+ * ids: ["ids"]
4513
+ * })
4514
+ */
4515
+ deleteTraces(request: BatchDelete, requestOptions?: Traces.RequestOptions): Promise<void>;
4516
+ /**
4517
+ * Find Feedback Score names
4518
+ *
4519
+ * @param {OpikApi.FindFeedbackScoreNames2Request} request
4520
+ * @param {Traces.RequestOptions} requestOptions - Request-specific configuration.
4521
+ *
4522
+ * @example
4523
+ * await client.traces.findFeedbackScoreNames2()
4524
+ */
4525
+ findFeedbackScoreNames2(request?: FindFeedbackScoreNames2Request, requestOptions?: Traces.RequestOptions): Promise<string[]>;
4526
+ /**
4527
+ * Get trace stats
4528
+ *
4529
+ * @param {OpikApi.GetTraceStatsRequest} request
4530
+ * @param {Traces.RequestOptions} requestOptions - Request-specific configuration.
4531
+ *
4532
+ * @example
4533
+ * await client.traces.getTraceStats()
4534
+ */
4535
+ getTraceStats(request?: GetTraceStatsRequest, requestOptions?: Traces.RequestOptions): Promise<ProjectStatsPublic>;
4536
+ /**
4537
+ * Get trace comment
4538
+ *
4539
+ * @param {string} commentId
4540
+ * @param {string} traceId
4541
+ * @param {Traces.RequestOptions} requestOptions - Request-specific configuration.
4542
+ *
4543
+ * @throws {@link OpikApi.NotFoundError}
4544
+ *
4545
+ * @example
4546
+ * await client.traces.getTraceComment("commentId", "traceId")
4547
+ */
4548
+ getTraceComment(commentId: string, traceId: string, requestOptions?: Traces.RequestOptions): Promise<Comment>;
4549
+ /**
4550
+ * Batch feedback scoring for traces
4551
+ *
4552
+ * @param {OpikApi.FeedbackScoreBatch} request
4553
+ * @param {Traces.RequestOptions} requestOptions - Request-specific configuration.
4554
+ *
4555
+ * @example
4556
+ * await client.traces.scoreBatchOfTraces({
4557
+ * scores: [{
4558
+ * id: "id",
4559
+ * name: "name",
4560
+ * value: 1.1,
4561
+ * source: "ui"
4562
+ * }]
4563
+ * })
4564
+ */
4565
+ scoreBatchOfTraces(request: FeedbackScoreBatch, requestOptions?: Traces.RequestOptions): Promise<void>;
4566
+ /**
4567
+ * Update trace comment by id
4568
+ *
4569
+ * @param {string} commentId
4570
+ * @param {OpikApi.Comment} request
4571
+ * @param {Traces.RequestOptions} requestOptions - Request-specific configuration.
4572
+ *
4573
+ * @throws {@link OpikApi.NotFoundError}
4574
+ *
4575
+ * @example
4576
+ * await client.traces.updateTraceComment("commentId", {
4577
+ * text: "text"
4578
+ * })
4579
+ */
4580
+ updateTraceComment(commentId: string, request: Comment, requestOptions?: Traces.RequestOptions): Promise<void>;
4581
+ protected _getCustomAuthorizationHeaders(): Promise<{
4582
+ Authorization: string | undefined;
4583
+ }>;
4584
+ }
4585
+
4586
+ /**
4587
+ * This file was auto-generated by Fern from our API Definition.
4588
+ */
4589
+
4590
+ declare namespace OpikApiClient {
4591
+ interface Options {
4592
+ environment?: Supplier<OpikApiEnvironment | string>;
4593
+ /** Specify a custom URL to connect the client to. */
4594
+ baseUrl?: Supplier<string>;
4595
+ /** Override the Authorization header */
4596
+ apiKey?: Supplier<string | undefined>;
4597
+ /** Override the Comet-Workspace header */
4598
+ workspaceName?: Supplier<string | undefined>;
4599
+ }
4600
+ interface RequestOptions {
4601
+ /** The maximum time to wait for a response in seconds. */
4602
+ timeoutInSeconds?: number;
4603
+ /** The number of times to retry the request. Defaults to 2. */
4604
+ maxRetries?: number;
4605
+ /** A hook to abort the request. */
4606
+ abortSignal?: AbortSignal;
4607
+ /** Override the Authorization header */
4608
+ apiKey?: string | undefined;
4609
+ /** Override the Comet-Workspace header */
4610
+ workspaceName?: string | undefined;
4611
+ /** Additional headers to include in the request. */
4612
+ headers?: Record<string, string>;
4613
+ }
4614
+ }
4615
+ declare class OpikApiClient {
4616
+ protected readonly _options: OpikApiClient.Options;
4617
+ protected _systemUsage: SystemUsage | undefined;
4618
+ protected _check: Check | undefined;
4619
+ protected _automationRuleEvaluators: AutomationRuleEvaluators | undefined;
4620
+ protected _chatCompletions: ChatCompletions | undefined;
4621
+ protected _datasets: Datasets | undefined;
4622
+ protected _experiments: Experiments | undefined;
4623
+ protected _feedbackDefinitions: FeedbackDefinitions | undefined;
4624
+ protected _llmProviderKey: LlmProviderKey | undefined;
4625
+ protected _projects: Projects | undefined;
4626
+ protected _prompts: Prompts | undefined;
4627
+ protected _spans: Spans | undefined;
4628
+ protected _traces: Traces | undefined;
4629
+ constructor(_options?: OpikApiClient.Options);
4630
+ get systemUsage(): SystemUsage;
4631
+ get check(): Check;
4632
+ get automationRuleEvaluators(): AutomationRuleEvaluators;
4633
+ get chatCompletions(): ChatCompletions;
4634
+ get datasets(): Datasets;
4635
+ get experiments(): Experiments;
4636
+ get feedbackDefinitions(): FeedbackDefinitions;
4637
+ get llmProviderKey(): LlmProviderKey;
4638
+ get projects(): Projects;
4639
+ get prompts(): Prompts;
4640
+ get spans(): Spans;
4641
+ get traces(): Traces;
4642
+ /**
4643
+ * @param {OpikApiClient.RequestOptions} requestOptions - Request-specific configuration.
4644
+ *
4645
+ * @example
4646
+ * await client.isAlive()
4647
+ */
4648
+ isAlive(requestOptions?: OpikApiClient.RequestOptions): Promise<unknown>;
4649
+ /**
4650
+ * @param {OpikApiClient.RequestOptions} requestOptions - Request-specific configuration.
4651
+ *
4652
+ * @example
4653
+ * await client.version()
4654
+ */
4655
+ version(requestOptions?: OpikApiClient.RequestOptions): Promise<unknown>;
4656
+ protected _getCustomAuthorizationHeaders(): Promise<{
4657
+ Authorization: string | undefined;
4658
+ }>;
4659
+ }
4660
+
4661
+ interface SavedSpan extends Span$1 {
4662
+ id: string;
4663
+ }
4664
+ declare class Span {
4665
+ data: SavedSpan;
4666
+ private opik;
4667
+ constructor(data: SavedSpan, opik: OpikClient);
4668
+ end: () => this;
4669
+ update: (updates: Omit<SpanUpdate$1, "traceId" | "parentSpanId" | "projectId" | "projectName">) => this;
4670
+ }
4671
+
4672
+ interface SavedTrace extends Trace$1 {
4673
+ id: string;
4674
+ }
4675
+ interface SpanData extends Omit<Span$1, "startTime" | "traceId"> {
4676
+ startTime?: Date;
4677
+ }
4678
+ declare class Trace {
4679
+ data: SavedTrace;
4680
+ private opik;
4681
+ private spans;
4682
+ constructor(data: SavedTrace, opik: OpikClient);
4683
+ end: () => this;
4684
+ span: (spanData: SpanData) => Span;
4685
+ update: (updates: Omit<TraceUpdate, "projectId">) => this;
4686
+ }
4687
+
4688
+ type CreateEntity = {
4689
+ id: string;
4690
+ };
4691
+ declare abstract class BatchQueue<EntityData = {}> {
4692
+ private readonly createQueue;
4693
+ private readonly updateQueue;
4694
+ private readonly deleteQueue;
4695
+ private readonly name;
4696
+ constructor({ delay, enableCreateBatch, enableDeleteBatch, name, }: {
4697
+ delay?: number;
4698
+ enableCreateBatch?: boolean;
4699
+ enableDeleteBatch?: boolean;
4700
+ name?: string;
4701
+ });
4702
+ protected abstract createEntities(entities: EntityData[]): Promise<void>;
4703
+ protected abstract getEntity(id: string): Promise<EntityData | undefined>;
4704
+ protected abstract updateEntity(id: string, updates: Partial<EntityData>): Promise<void>;
4705
+ protected abstract deleteEntities(ids: string[]): Promise<void>;
4706
+ create: (entity: CreateEntity & EntityData) => void;
4707
+ get: (id: string) => Promise<EntityData | undefined>;
4708
+ update: (id: string, updates: Partial<EntityData>) => void;
4709
+ delete: (id: string) => void;
4710
+ flush: () => Promise<void>;
4711
+ }
4712
+
4713
+ type SpanUpdate = Partial<SavedSpan> & {
4714
+ traceId: string;
4715
+ };
4716
+ declare class SpanBatchQueue extends BatchQueue<SavedSpan> {
4717
+ private readonly api;
4718
+ constructor(api: OpikApiClient, delay?: number);
4719
+ protected createEntities(spans: SavedSpan[]): Promise<void>;
4720
+ protected getEntity(id: string): Promise<SavedSpan>;
4721
+ protected updateEntity(id: string, updates: SpanUpdate): Promise<void>;
4722
+ protected deleteEntities(ids: string[]): Promise<void>;
4723
+ }
4724
+
4725
+ declare class TraceBatchQueue extends BatchQueue<SavedTrace> {
4726
+ private readonly api;
4727
+ constructor(api: OpikApiClient, delay?: number);
4728
+ protected createEntities(traces: SavedTrace[]): Promise<void>;
4729
+ protected getEntity(id: string): Promise<SavedTrace>;
4730
+ protected updateEntity(id: string, updates: Partial<SavedTrace>): Promise<void>;
4731
+ protected deleteEntities(ids: string[]): Promise<void>;
4732
+ }
4733
+
4734
+ interface TraceData extends Omit<Trace$1, "startTime"> {
4735
+ startTime?: Date;
4736
+ }
4737
+ declare class OpikClient {
4738
+ api: OpikApiClient;
4739
+ config: OpikConfig;
4740
+ spanBatchQueue: SpanBatchQueue;
4741
+ traceBatchQueue: TraceBatchQueue;
4742
+ constructor(explicitConfig?: Partial<OpikConfig>);
4743
+ trace: (traceData: TraceData) => Trace;
4744
+ flush: () => Promise<void>;
4745
+ }
4746
+
4747
+ export { OpikClient as O, SpanType as S, Trace as T, type OpikConfig as a, Span as b };