opik 0.0.8 → 0.0.9

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