@langfuse/core 4.5.0 → 4.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -97,6 +97,21 @@ declare class Logger {
97
97
  * @returns The current log level
98
98
  */
99
99
  getLevel(): LogLevel;
100
+ /**
101
+ * Checks if a given log level is enabled.
102
+ * Use this to guard expensive operations (like JSON.stringify) before debug logging.
103
+ *
104
+ * @param level - The log level to check
105
+ * @returns True if the level is enabled, false otherwise
106
+ *
107
+ * @example
108
+ * ```typescript
109
+ * if (logger.isLevelEnabled(LogLevel.DEBUG)) {
110
+ * logger.debug('Expensive data:', JSON.stringify(largeObject));
111
+ * }
112
+ * ```
113
+ */
114
+ isLevelEnabled(level: LogLevel): boolean;
100
115
  }
101
116
  /**
102
117
  * Singleton class that manages a global logger instance.
@@ -375,23 +390,23 @@ interface GetAnnotationQueueItemsRequest {
375
390
  limit?: number;
376
391
  }
377
392
 
378
- type index$q_AnnotationQueue = AnnotationQueue;
379
- type index$q_AnnotationQueueAssignmentRequest = AnnotationQueueAssignmentRequest;
380
- type index$q_AnnotationQueueItem = AnnotationQueueItem;
381
- declare const index$q_AnnotationQueueObjectType: typeof AnnotationQueueObjectType;
382
- declare const index$q_AnnotationQueueStatus: typeof AnnotationQueueStatus;
383
- type index$q_CreateAnnotationQueueAssignmentResponse = CreateAnnotationQueueAssignmentResponse;
384
- type index$q_CreateAnnotationQueueItemRequest = CreateAnnotationQueueItemRequest;
385
- type index$q_CreateAnnotationQueueRequest = CreateAnnotationQueueRequest;
386
- type index$q_DeleteAnnotationQueueAssignmentResponse = DeleteAnnotationQueueAssignmentResponse;
387
- type index$q_DeleteAnnotationQueueItemResponse = DeleteAnnotationQueueItemResponse;
388
- type index$q_GetAnnotationQueueItemsRequest = GetAnnotationQueueItemsRequest;
389
- type index$q_GetAnnotationQueuesRequest = GetAnnotationQueuesRequest;
390
- type index$q_PaginatedAnnotationQueueItems = PaginatedAnnotationQueueItems;
391
- type index$q_PaginatedAnnotationQueues = PaginatedAnnotationQueues;
392
- type index$q_UpdateAnnotationQueueItemRequest = UpdateAnnotationQueueItemRequest;
393
- declare namespace index$q {
394
- export { type index$q_AnnotationQueue as AnnotationQueue, type index$q_AnnotationQueueAssignmentRequest as AnnotationQueueAssignmentRequest, type index$q_AnnotationQueueItem as AnnotationQueueItem, index$q_AnnotationQueueObjectType as AnnotationQueueObjectType, index$q_AnnotationQueueStatus as AnnotationQueueStatus, type index$q_CreateAnnotationQueueAssignmentResponse as CreateAnnotationQueueAssignmentResponse, type index$q_CreateAnnotationQueueItemRequest as CreateAnnotationQueueItemRequest, type index$q_CreateAnnotationQueueRequest as CreateAnnotationQueueRequest, type index$q_DeleteAnnotationQueueAssignmentResponse as DeleteAnnotationQueueAssignmentResponse, type index$q_DeleteAnnotationQueueItemResponse as DeleteAnnotationQueueItemResponse, type index$q_GetAnnotationQueueItemsRequest as GetAnnotationQueueItemsRequest, type index$q_GetAnnotationQueuesRequest as GetAnnotationQueuesRequest, type index$q_PaginatedAnnotationQueueItems as PaginatedAnnotationQueueItems, type index$q_PaginatedAnnotationQueues as PaginatedAnnotationQueues, type index$q_UpdateAnnotationQueueItemRequest as UpdateAnnotationQueueItemRequest };
393
+ type index$s_AnnotationQueue = AnnotationQueue;
394
+ type index$s_AnnotationQueueAssignmentRequest = AnnotationQueueAssignmentRequest;
395
+ type index$s_AnnotationQueueItem = AnnotationQueueItem;
396
+ declare const index$s_AnnotationQueueObjectType: typeof AnnotationQueueObjectType;
397
+ declare const index$s_AnnotationQueueStatus: typeof AnnotationQueueStatus;
398
+ type index$s_CreateAnnotationQueueAssignmentResponse = CreateAnnotationQueueAssignmentResponse;
399
+ type index$s_CreateAnnotationQueueItemRequest = CreateAnnotationQueueItemRequest;
400
+ type index$s_CreateAnnotationQueueRequest = CreateAnnotationQueueRequest;
401
+ type index$s_DeleteAnnotationQueueAssignmentResponse = DeleteAnnotationQueueAssignmentResponse;
402
+ type index$s_DeleteAnnotationQueueItemResponse = DeleteAnnotationQueueItemResponse;
403
+ type index$s_GetAnnotationQueueItemsRequest = GetAnnotationQueueItemsRequest;
404
+ type index$s_GetAnnotationQueuesRequest = GetAnnotationQueuesRequest;
405
+ type index$s_PaginatedAnnotationQueueItems = PaginatedAnnotationQueueItems;
406
+ type index$s_PaginatedAnnotationQueues = PaginatedAnnotationQueues;
407
+ type index$s_UpdateAnnotationQueueItemRequest = UpdateAnnotationQueueItemRequest;
408
+ declare namespace index$s {
409
+ export { type index$s_AnnotationQueue as AnnotationQueue, type index$s_AnnotationQueueAssignmentRequest as AnnotationQueueAssignmentRequest, type index$s_AnnotationQueueItem as AnnotationQueueItem, index$s_AnnotationQueueObjectType as AnnotationQueueObjectType, index$s_AnnotationQueueStatus as AnnotationQueueStatus, type index$s_CreateAnnotationQueueAssignmentResponse as CreateAnnotationQueueAssignmentResponse, type index$s_CreateAnnotationQueueItemRequest as CreateAnnotationQueueItemRequest, type index$s_CreateAnnotationQueueRequest as CreateAnnotationQueueRequest, type index$s_DeleteAnnotationQueueAssignmentResponse as DeleteAnnotationQueueAssignmentResponse, type index$s_DeleteAnnotationQueueItemResponse as DeleteAnnotationQueueItemResponse, type index$s_GetAnnotationQueueItemsRequest as GetAnnotationQueueItemsRequest, type index$s_GetAnnotationQueuesRequest as GetAnnotationQueuesRequest, type index$s_PaginatedAnnotationQueueItems as PaginatedAnnotationQueueItems, type index$s_PaginatedAnnotationQueues as PaginatedAnnotationQueues, type index$s_UpdateAnnotationQueueItemRequest as UpdateAnnotationQueueItemRequest };
395
410
  }
396
411
 
397
412
  /**
@@ -505,16 +520,16 @@ interface BlobStorageIntegrationDeletionResponse {
505
520
  message: string;
506
521
  }
507
522
 
508
- declare const index$p_BlobStorageExportFrequency: typeof BlobStorageExportFrequency;
509
- declare const index$p_BlobStorageExportMode: typeof BlobStorageExportMode;
510
- type index$p_BlobStorageIntegrationDeletionResponse = BlobStorageIntegrationDeletionResponse;
511
- declare const index$p_BlobStorageIntegrationFileType: typeof BlobStorageIntegrationFileType;
512
- type index$p_BlobStorageIntegrationResponse = BlobStorageIntegrationResponse;
513
- declare const index$p_BlobStorageIntegrationType: typeof BlobStorageIntegrationType;
514
- type index$p_BlobStorageIntegrationsResponse = BlobStorageIntegrationsResponse;
515
- type index$p_CreateBlobStorageIntegrationRequest = CreateBlobStorageIntegrationRequest;
516
- declare namespace index$p {
517
- export { index$p_BlobStorageExportFrequency as BlobStorageExportFrequency, index$p_BlobStorageExportMode as BlobStorageExportMode, type index$p_BlobStorageIntegrationDeletionResponse as BlobStorageIntegrationDeletionResponse, index$p_BlobStorageIntegrationFileType as BlobStorageIntegrationFileType, type index$p_BlobStorageIntegrationResponse as BlobStorageIntegrationResponse, index$p_BlobStorageIntegrationType as BlobStorageIntegrationType, type index$p_BlobStorageIntegrationsResponse as BlobStorageIntegrationsResponse, type index$p_CreateBlobStorageIntegrationRequest as CreateBlobStorageIntegrationRequest };
523
+ declare const index$r_BlobStorageExportFrequency: typeof BlobStorageExportFrequency;
524
+ declare const index$r_BlobStorageExportMode: typeof BlobStorageExportMode;
525
+ type index$r_BlobStorageIntegrationDeletionResponse = BlobStorageIntegrationDeletionResponse;
526
+ declare const index$r_BlobStorageIntegrationFileType: typeof BlobStorageIntegrationFileType;
527
+ type index$r_BlobStorageIntegrationResponse = BlobStorageIntegrationResponse;
528
+ declare const index$r_BlobStorageIntegrationType: typeof BlobStorageIntegrationType;
529
+ type index$r_BlobStorageIntegrationsResponse = BlobStorageIntegrationsResponse;
530
+ type index$r_CreateBlobStorageIntegrationRequest = CreateBlobStorageIntegrationRequest;
531
+ declare namespace index$r {
532
+ export { index$r_BlobStorageExportFrequency as BlobStorageExportFrequency, index$r_BlobStorageExportMode as BlobStorageExportMode, type index$r_BlobStorageIntegrationDeletionResponse as BlobStorageIntegrationDeletionResponse, index$r_BlobStorageIntegrationFileType as BlobStorageIntegrationFileType, type index$r_BlobStorageIntegrationResponse as BlobStorageIntegrationResponse, index$r_BlobStorageIntegrationType as BlobStorageIntegrationType, type index$r_BlobStorageIntegrationsResponse as BlobStorageIntegrationsResponse, type index$r_CreateBlobStorageIntegrationRequest as CreateBlobStorageIntegrationRequest };
518
533
  }
519
534
 
520
535
  /**
@@ -570,12 +585,12 @@ interface GetCommentsRequest {
570
585
  authorUserId?: string;
571
586
  }
572
587
 
573
- type index$o_CreateCommentRequest = CreateCommentRequest;
574
- type index$o_CreateCommentResponse = CreateCommentResponse;
575
- type index$o_GetCommentsRequest = GetCommentsRequest;
576
- type index$o_GetCommentsResponse = GetCommentsResponse;
577
- declare namespace index$o {
578
- export type { index$o_CreateCommentRequest as CreateCommentRequest, index$o_CreateCommentResponse as CreateCommentResponse, index$o_GetCommentsRequest as GetCommentsRequest, index$o_GetCommentsResponse as GetCommentsResponse };
588
+ type index$q_CreateCommentRequest = CreateCommentRequest;
589
+ type index$q_CreateCommentResponse = CreateCommentResponse;
590
+ type index$q_GetCommentsRequest = GetCommentsRequest;
591
+ type index$q_GetCommentsResponse = GetCommentsResponse;
592
+ declare namespace index$q {
593
+ export type { index$q_CreateCommentRequest as CreateCommentRequest, index$q_CreateCommentResponse as CreateCommentResponse, index$q_GetCommentsRequest as GetCommentsRequest, index$q_GetCommentsResponse as GetCommentsResponse };
579
594
  }
580
595
 
581
596
  /**
@@ -587,27 +602,27 @@ interface Trace$1 {
587
602
  /** The timestamp when the trace was created */
588
603
  timestamp: string;
589
604
  /** The name of the trace */
590
- name?: string;
605
+ name: string | null;
591
606
  /** The input data of the trace. Can be any JSON. */
592
607
  input?: unknown;
593
608
  /** The output data of the trace. Can be any JSON. */
594
609
  output?: unknown;
595
610
  /** The session identifier associated with the trace */
596
- sessionId?: string;
611
+ sessionId: string | null;
597
612
  /** The release version of the application when the trace was created */
598
- release?: string;
613
+ release: string | null;
599
614
  /** The version of the trace */
600
- version?: string;
615
+ version: string | null;
601
616
  /** The user identifier associated with the trace */
602
- userId?: string;
617
+ userId: string | null;
603
618
  /** The metadata associated with the trace. Can be any JSON. */
604
619
  metadata?: unknown;
605
- /** The tags associated with the trace. Can be an array of strings or null. */
606
- tags?: string[];
620
+ /** The tags associated with the trace. */
621
+ tags: string[];
607
622
  /** Public traces are accessible via url without login */
608
- public?: boolean;
623
+ public: boolean;
609
624
  /** The environment from which this trace originated. Can be any lowercase alphanumeric string with hyphens and underscores that does not start with 'langfuse'. */
610
- environment?: string;
625
+ environment: string;
611
626
  }
612
627
 
613
628
  /**
@@ -618,13 +633,13 @@ interface TraceWithDetails extends Trace$1 {
618
633
  /** Path of trace in Langfuse UI */
619
634
  htmlPath: string;
620
635
  /** Latency of trace in seconds */
621
- latency: number;
636
+ latency?: number | null;
622
637
  /** Cost of trace in USD */
623
- totalCost: number;
638
+ totalCost?: number | null;
624
639
  /** List of observation ids */
625
- observations: string[];
640
+ observations?: string[] | null;
626
641
  /** List of score ids */
627
- scores: string[];
642
+ scores?: string[] | null;
628
643
  }
629
644
 
630
645
  /**
@@ -635,9 +650,9 @@ interface TraceWithFullDetails extends Trace$1 {
635
650
  /** Path of trace in Langfuse UI */
636
651
  htmlPath: string;
637
652
  /** Latency of trace in seconds */
638
- latency: number;
653
+ latency?: number | null;
639
654
  /** Cost of trace in USD */
640
- totalCost: number;
655
+ totalCost?: number | null;
641
656
  /** List of observations */
642
657
  observations: ObservationsView[];
643
658
  /** List of scores */
@@ -652,7 +667,7 @@ interface Session {
652
667
  createdAt: string;
653
668
  projectId: string;
654
669
  /** The environment from which this session originated. */
655
- environment?: string;
670
+ environment: string;
656
671
  }
657
672
 
658
673
  /**
@@ -671,45 +686,45 @@ interface Observation {
671
686
  /** The unique identifier of the observation */
672
687
  id: string;
673
688
  /** The trace ID associated with the observation */
674
- traceId?: string;
689
+ traceId: string | null;
675
690
  /** The type of the observation */
676
691
  type: string;
677
692
  /** The name of the observation */
678
- name?: string;
693
+ name: string | null;
679
694
  /** The start time of the observation */
680
695
  startTime: string;
681
696
  /** The end time of the observation. */
682
- endTime?: string;
697
+ endTime: string | null;
683
698
  /** The completion start time of the observation */
684
- completionStartTime?: string;
699
+ completionStartTime: string | null;
685
700
  /** The model used for the observation */
686
- model?: string;
701
+ model: string | null;
687
702
  /** The parameters of the model used for the observation */
688
- modelParameters?: Record<string, MapValue>;
703
+ modelParameters?: unknown;
689
704
  /** The input data of the observation */
690
705
  input?: unknown;
691
706
  /** The version of the observation */
692
- version?: string;
707
+ version: string | null;
693
708
  /** Additional metadata of the observation */
694
709
  metadata?: unknown;
695
710
  /** The output data of the observation */
696
711
  output?: unknown;
697
712
  /** (Deprecated. Use usageDetails and costDetails instead.) The usage data of the observation */
698
- usage?: Usage;
713
+ usage: Usage;
699
714
  /** The level of the observation */
700
715
  level: ObservationLevel;
701
716
  /** The status message of the observation */
702
- statusMessage?: string;
717
+ statusMessage: string | null;
703
718
  /** The parent observation ID */
704
- parentObservationId?: string;
719
+ parentObservationId: string | null;
705
720
  /** The prompt ID associated with the observation */
706
- promptId?: string;
721
+ promptId: string | null;
707
722
  /** The usage details of the observation. Key is the name of the usage metric, value is the number of units consumed. The total key is the sum of all (non-total) usage metrics or the total value ingested. */
708
- usageDetails?: Record<string, number>;
723
+ usageDetails: Record<string, number>;
709
724
  /** The cost details of the observation. Key is the name of the cost metric, value is the cost in USD. The total key is the sum of all (non-total) cost metrics or the total value ingested. */
710
- costDetails?: Record<string, number>;
725
+ costDetails: Record<string, number>;
711
726
  /** The environment from which this observation originated. Can be any lowercase alphanumeric string with hyphens and underscores that does not start with 'langfuse'. */
712
- environment?: string;
727
+ environment: string;
713
728
  }
714
729
 
715
730
  /**
@@ -718,44 +733,44 @@ interface Observation {
718
733
 
719
734
  interface ObservationsView extends Observation {
720
735
  /** The name of the prompt associated with the observation */
721
- promptName?: string;
736
+ promptName: string | null;
722
737
  /** The version of the prompt associated with the observation */
723
- promptVersion?: number;
738
+ promptVersion: number | null;
724
739
  /** The unique identifier of the model */
725
- modelId?: string;
740
+ modelId: string | null;
726
741
  /** The price of the input in USD */
727
- inputPrice?: number;
742
+ inputPrice: number | null;
728
743
  /** The price of the output in USD. */
729
- outputPrice?: number;
744
+ outputPrice: number | null;
730
745
  /** The total price in USD. */
731
- totalPrice?: number;
746
+ totalPrice: number | null;
732
747
  /** (Deprecated. Use usageDetails and costDetails instead.) The calculated cost of the input in USD */
733
- calculatedInputCost?: number;
748
+ calculatedInputCost: number | null;
734
749
  /** (Deprecated. Use usageDetails and costDetails instead.) The calculated cost of the output in USD */
735
- calculatedOutputCost?: number;
750
+ calculatedOutputCost: number | null;
736
751
  /** (Deprecated. Use usageDetails and costDetails instead.) The calculated total cost in USD */
737
- calculatedTotalCost?: number;
752
+ calculatedTotalCost: number | null;
738
753
  /** The latency in seconds. */
739
- latency?: number;
754
+ latency: number | null;
740
755
  /** The time to the first token in seconds */
741
- timeToFirstToken?: number;
756
+ timeToFirstToken: number | null;
742
757
  }
743
758
 
744
759
  /**
745
760
  * This file was auto-generated by Fern from our API Definition.
746
761
  */
747
-
748
762
  /**
749
763
  * (Deprecated. Use usageDetails and costDetails instead.) Standard interface for usage and cost
750
764
  */
751
765
  interface Usage {
752
766
  /** Number of input units (e.g. tokens) */
753
- input?: number;
767
+ input: number;
754
768
  /** Number of output units (e.g. tokens) */
755
- output?: number;
769
+ output: number;
756
770
  /** Defaults to input+output if not set */
757
- total?: number;
758
- unit?: ModelUsageUnit;
771
+ total: number;
772
+ /** Unit of measurement */
773
+ unit: string | null;
759
774
  /** USD input cost */
760
775
  inputCost?: number;
761
776
  /** USD output cost */
@@ -777,16 +792,17 @@ interface ScoreConfig {
777
792
  createdAt: string;
778
793
  updatedAt: string;
779
794
  projectId: string;
780
- dataType: ScoreDataType;
795
+ dataType: ScoreConfigDataType;
781
796
  /** Whether the score config is archived. Defaults to false */
782
797
  isArchived: boolean;
783
798
  /** Sets minimum value for numerical scores. If not set, the minimum value defaults to -∞ */
784
- minValue?: number;
799
+ minValue?: number | null;
785
800
  /** Sets maximum value for numerical scores. If not set, the maximum value defaults to +∞ */
786
- maxValue?: number;
801
+ maxValue?: number | null;
787
802
  /** Configures custom categories for categorical scores */
788
803
  categories?: ConfigCategory[];
789
- description?: string;
804
+ /** Description of the score config */
805
+ description?: string | null;
790
806
  }
791
807
 
792
808
  /**
@@ -806,19 +822,23 @@ interface BaseScoreV1 {
806
822
  traceId: string;
807
823
  name: string;
808
824
  source: ScoreSource;
809
- observationId?: string;
825
+ /** The observation ID associated with the score */
826
+ observationId?: string | null;
810
827
  timestamp: string;
811
828
  createdAt: string;
812
829
  updatedAt: string;
813
- authorUserId?: string;
814
- comment?: string;
830
+ /** The user ID of the author */
831
+ authorUserId: string | null;
832
+ /** Comment on the score */
833
+ comment: string | null;
834
+ /** Metadata associated with the score */
815
835
  metadata?: unknown;
816
836
  /** Reference a score config on a score. When set, config and score name must be equal and value must comply to optionally defined numerical range */
817
- configId?: string;
837
+ configId: string | null;
818
838
  /** The annotation queue referenced by the score. Indicates if score was initially created while processing annotation queue. */
819
- queueId?: string;
839
+ queueId: string | null;
820
840
  /** The environment from which this score originated. Can be any lowercase alphanumeric string with hyphens and underscores that does not start with 'langfuse'. */
821
- environment?: string;
841
+ environment: string;
822
842
  }
823
843
 
824
844
  /**
@@ -884,24 +904,31 @@ declare namespace ScoreV1 {
884
904
 
885
905
  interface BaseScore {
886
906
  id: string;
887
- traceId?: string;
888
- sessionId?: string;
889
- observationId?: string;
890
- datasetRunId?: string;
907
+ /** The trace ID associated with the score */
908
+ traceId?: string | null;
909
+ /** The session ID associated with the score */
910
+ sessionId?: string | null;
911
+ /** The observation ID associated with the score */
912
+ observationId?: string | null;
913
+ /** The dataset run ID associated with the score */
914
+ datasetRunId?: string | null;
891
915
  name: string;
892
916
  source: ScoreSource;
893
917
  timestamp: string;
894
918
  createdAt: string;
895
919
  updatedAt: string;
896
- authorUserId?: string;
897
- comment?: string;
920
+ /** The user ID of the author */
921
+ authorUserId: string | null;
922
+ /** Comment on the score */
923
+ comment: string | null;
924
+ /** Metadata associated with the score */
898
925
  metadata?: unknown;
899
926
  /** Reference a score config on a score. When set, config and score name must be equal and value must comply to optionally defined numerical range */
900
- configId?: string;
927
+ configId: string | null;
901
928
  /** The annotation queue referenced by the score. Indicates if score was initially created while processing annotation queue. */
902
- queueId?: string;
929
+ queueId: string | null;
903
930
  /** The environment from which this score originated. Can be any lowercase alphanumeric string with hyphens and underscores that does not start with 'langfuse'. */
904
- environment?: string;
931
+ environment: string;
905
932
  }
906
933
 
907
934
  /**
@@ -935,6 +962,17 @@ interface CategoricalScore extends BaseScore {
935
962
  stringValue: string;
936
963
  }
937
964
 
965
+ /**
966
+ * This file was auto-generated by Fern from our API Definition.
967
+ */
968
+
969
+ interface CorrectionScore extends BaseScore {
970
+ /** The numeric value of the score. Always 0 for correction scores. */
971
+ value: number;
972
+ /** The string representation of the correction content */
973
+ stringValue: string;
974
+ }
975
+
938
976
  /**
939
977
  * This file was auto-generated by Fern from our API Definition.
940
978
  */
@@ -948,7 +986,10 @@ Score$1.Numeric
948
986
  | Score$1.Categorical
949
987
  /**
950
988
  * Score with BOOLEAN data type */
951
- | Score$1.Boolean;
989
+ | Score$1.Boolean
990
+ /**
991
+ * Score with CORRECTION data type */
992
+ | Score$1.Correction;
952
993
  declare namespace Score$1 {
953
994
  interface Numeric extends NumericScore {
954
995
  dataType: "NUMERIC";
@@ -959,6 +1000,9 @@ declare namespace Score$1 {
959
1000
  interface Boolean extends BooleanScore {
960
1001
  dataType: "BOOLEAN";
961
1002
  }
1003
+ interface Correction extends CorrectionScore {
1004
+ dataType: "CORRECTION";
1005
+ }
962
1006
  }
963
1007
 
964
1008
  /**
@@ -981,7 +1025,8 @@ interface Comment {
981
1025
  objectType: CommentObjectType;
982
1026
  objectId: string;
983
1027
  content: string;
984
- authorUserId?: string;
1028
+ /** The user ID of the comment author */
1029
+ authorUserId?: string | null;
985
1030
  }
986
1031
 
987
1032
  /**
@@ -990,12 +1035,14 @@ interface Comment {
990
1035
  interface Dataset {
991
1036
  id: string;
992
1037
  name: string;
993
- description?: string;
1038
+ /** Description of the dataset */
1039
+ description: string | null;
1040
+ /** Metadata associated with the dataset */
994
1041
  metadata?: unknown;
995
1042
  /** JSON Schema for validating dataset item inputs */
996
- inputSchema?: unknown;
1043
+ inputSchema: unknown | null;
997
1044
  /** JSON Schema for validating dataset item expected outputs */
998
- expectedOutputSchema?: unknown;
1045
+ expectedOutputSchema: unknown | null;
999
1046
  projectId: string;
1000
1047
  createdAt: string;
1001
1048
  updatedAt: string;
@@ -1008,11 +1055,16 @@ interface Dataset {
1008
1055
  interface DatasetItem {
1009
1056
  id: string;
1010
1057
  status: DatasetStatus;
1058
+ /** Input data for the dataset item */
1011
1059
  input?: unknown;
1060
+ /** Expected output for the dataset item */
1012
1061
  expectedOutput?: unknown;
1062
+ /** Metadata associated with the dataset item */
1013
1063
  metadata?: unknown;
1014
- sourceTraceId?: string;
1015
- sourceObservationId?: string;
1064
+ /** The trace ID that sourced this dataset item */
1065
+ sourceTraceId: string | null;
1066
+ /** The observation ID that sourced this dataset item */
1067
+ sourceObservationId: string | null;
1016
1068
  datasetId: string;
1017
1069
  datasetName: string;
1018
1070
  createdAt: string;
@@ -1028,7 +1080,8 @@ interface DatasetRunItem {
1028
1080
  datasetRunName: string;
1029
1081
  datasetItemId: string;
1030
1082
  traceId: string;
1031
- observationId?: string;
1083
+ /** The observation ID associated with this run item */
1084
+ observationId: string | null;
1032
1085
  createdAt: string;
1033
1086
  updatedAt: string;
1034
1087
  }
@@ -1042,7 +1095,7 @@ interface DatasetRun {
1042
1095
  /** Name of the dataset run */
1043
1096
  name: string;
1044
1097
  /** Description of the run */
1045
- description?: string;
1098
+ description: string | null;
1046
1099
  /** Metadata of the dataset run */
1047
1100
  metadata?: unknown;
1048
1101
  /** Id of the associated dataset */
@@ -1085,17 +1138,17 @@ interface Model {
1085
1138
  /** Regex pattern which matches this model definition to generation.model. Useful in case of fine-tuned models. If you want to exact match, use `(?i)^modelname$` */
1086
1139
  matchPattern: string;
1087
1140
  /** Apply only to generations which are newer than this ISO date. */
1088
- startDate?: string;
1141
+ startDate: string | null;
1089
1142
  /** Unit used by this model. */
1090
- unit?: ModelUsageUnit;
1143
+ unit?: ModelUsageUnit | null;
1091
1144
  /** Deprecated. See 'prices' instead. Price (USD) per input unit */
1092
- inputPrice?: number;
1145
+ inputPrice: number | null;
1093
1146
  /** Deprecated. See 'prices' instead. Price (USD) per output unit */
1094
- outputPrice?: number;
1147
+ outputPrice: number | null;
1095
1148
  /** Deprecated. See 'prices' instead. Price (USD) per total unit. Cannot be set if input or output price is set. */
1096
- totalPrice?: number;
1149
+ totalPrice: number | null;
1097
1150
  /** Optional. Tokenizer to be applied to observations which match to this model. See docs for more details. */
1098
- tokenizerId?: string;
1151
+ tokenizerId: string | null;
1099
1152
  /** Optional. Configuration for the selected tokenizer. Needs to be JSON. See docs for more details. */
1100
1153
  tokenizerConfig?: unknown;
1101
1154
  isLangfuseManaged: boolean;
@@ -1389,11 +1442,22 @@ declare const ScoreSource: {
1389
1442
  /**
1390
1443
  * This file was auto-generated by Fern from our API Definition.
1391
1444
  */
1392
- type ScoreDataType = "NUMERIC" | "BOOLEAN" | "CATEGORICAL";
1445
+ type ScoreConfigDataType = "NUMERIC" | "BOOLEAN" | "CATEGORICAL";
1446
+ declare const ScoreConfigDataType: {
1447
+ readonly Numeric: "NUMERIC";
1448
+ readonly Boolean: "BOOLEAN";
1449
+ readonly Categorical: "CATEGORICAL";
1450
+ };
1451
+
1452
+ /**
1453
+ * This file was auto-generated by Fern from our API Definition.
1454
+ */
1455
+ type ScoreDataType = "NUMERIC" | "BOOLEAN" | "CATEGORICAL" | "CORRECTION";
1393
1456
  declare const ScoreDataType: {
1394
1457
  readonly Numeric: "NUMERIC";
1395
1458
  readonly Boolean: "BOOLEAN";
1396
1459
  readonly Categorical: "CATEGORICAL";
1460
+ readonly Correction: "CORRECTION";
1397
1461
  };
1398
1462
 
1399
1463
  /**
@@ -1536,54 +1600,56 @@ declare class MethodNotAllowedError extends LangfuseAPIError {
1536
1600
  constructor(body?: unknown, rawResponse?: RawResponse);
1537
1601
  }
1538
1602
 
1539
- type index$n_AccessDeniedError = AccessDeniedError;
1540
- declare const index$n_AccessDeniedError: typeof AccessDeniedError;
1541
- type index$n_BaseScore = BaseScore;
1542
- type index$n_BaseScoreV1 = BaseScoreV1;
1543
- type index$n_BooleanScore = BooleanScore;
1544
- type index$n_BooleanScoreV1 = BooleanScoreV1;
1545
- type index$n_CategoricalScore = CategoricalScore;
1546
- type index$n_CategoricalScoreV1 = CategoricalScoreV1;
1547
- type index$n_Comment = Comment;
1548
- declare const index$n_CommentObjectType: typeof CommentObjectType;
1549
- type index$n_ConfigCategory = ConfigCategory;
1550
- type index$n_CreateScoreValue = CreateScoreValue;
1551
- type index$n_Dataset = Dataset;
1552
- type index$n_DatasetItem = DatasetItem;
1553
- type index$n_DatasetRun = DatasetRun;
1554
- type index$n_DatasetRunItem = DatasetRunItem;
1555
- type index$n_DatasetRunWithItems = DatasetRunWithItems;
1556
- declare const index$n_DatasetStatus: typeof DatasetStatus;
1557
- type index$n_MapValue = MapValue;
1558
- type index$n_MethodNotAllowedError = MethodNotAllowedError;
1559
- declare const index$n_MethodNotAllowedError: typeof MethodNotAllowedError;
1560
- type index$n_Model = Model;
1561
- type index$n_ModelPrice = ModelPrice;
1562
- declare const index$n_ModelUsageUnit: typeof ModelUsageUnit;
1563
- type index$n_NotFoundError = NotFoundError;
1564
- declare const index$n_NotFoundError: typeof NotFoundError;
1565
- type index$n_NumericScore = NumericScore;
1566
- type index$n_NumericScoreV1 = NumericScoreV1;
1567
- type index$n_Observation = Observation;
1568
- declare const index$n_ObservationLevel: typeof ObservationLevel;
1569
- type index$n_ObservationsView = ObservationsView;
1570
- type index$n_PricingTier = PricingTier;
1571
- type index$n_PricingTierCondition = PricingTierCondition;
1572
- type index$n_PricingTierInput = PricingTierInput;
1573
- declare const index$n_PricingTierOperator: typeof PricingTierOperator;
1574
- type index$n_ScoreConfig = ScoreConfig;
1575
- declare const index$n_ScoreDataType: typeof ScoreDataType;
1576
- declare const index$n_ScoreSource: typeof ScoreSource;
1577
- declare const index$n_ScoreV1: typeof ScoreV1;
1578
- type index$n_Session = Session;
1579
- type index$n_SessionWithTraces = SessionWithTraces;
1580
- type index$n_TraceWithDetails = TraceWithDetails;
1581
- type index$n_TraceWithFullDetails = TraceWithFullDetails;
1582
- type index$n_UnauthorizedError = UnauthorizedError;
1583
- declare const index$n_UnauthorizedError: typeof UnauthorizedError;
1584
- type index$n_Usage = Usage;
1585
- declare namespace index$n {
1586
- export { index$n_AccessDeniedError as AccessDeniedError, type index$n_BaseScore as BaseScore, type index$n_BaseScoreV1 as BaseScoreV1, type index$n_BooleanScore as BooleanScore, type index$n_BooleanScoreV1 as BooleanScoreV1, type index$n_CategoricalScore as CategoricalScore, type index$n_CategoricalScoreV1 as CategoricalScoreV1, type index$n_Comment as Comment, index$n_CommentObjectType as CommentObjectType, type index$n_ConfigCategory as ConfigCategory, type index$n_CreateScoreValue as CreateScoreValue, type index$n_Dataset as Dataset, type index$n_DatasetItem as DatasetItem, type index$n_DatasetRun as DatasetRun, type index$n_DatasetRunItem as DatasetRunItem, type index$n_DatasetRunWithItems as DatasetRunWithItems, index$n_DatasetStatus as DatasetStatus, Error$1 as Error, type index$n_MapValue as MapValue, index$n_MethodNotAllowedError as MethodNotAllowedError, type index$n_Model as Model, type index$n_ModelPrice as ModelPrice, index$n_ModelUsageUnit as ModelUsageUnit, index$n_NotFoundError as NotFoundError, type index$n_NumericScore as NumericScore, type index$n_NumericScoreV1 as NumericScoreV1, type index$n_Observation as Observation, index$n_ObservationLevel as ObservationLevel, type index$n_ObservationsView as ObservationsView, type index$n_PricingTier as PricingTier, type index$n_PricingTierCondition as PricingTierCondition, type index$n_PricingTierInput as PricingTierInput, index$n_PricingTierOperator as PricingTierOperator, Score$1 as Score, type index$n_ScoreConfig as ScoreConfig, index$n_ScoreDataType as ScoreDataType, index$n_ScoreSource as ScoreSource, index$n_ScoreV1 as ScoreV1, type index$n_Session as Session, type index$n_SessionWithTraces as SessionWithTraces, type Trace$1 as Trace, type index$n_TraceWithDetails as TraceWithDetails, type index$n_TraceWithFullDetails as TraceWithFullDetails, index$n_UnauthorizedError as UnauthorizedError, type index$n_Usage as Usage };
1603
+ type index$p_AccessDeniedError = AccessDeniedError;
1604
+ declare const index$p_AccessDeniedError: typeof AccessDeniedError;
1605
+ type index$p_BaseScore = BaseScore;
1606
+ type index$p_BaseScoreV1 = BaseScoreV1;
1607
+ type index$p_BooleanScore = BooleanScore;
1608
+ type index$p_BooleanScoreV1 = BooleanScoreV1;
1609
+ type index$p_CategoricalScore = CategoricalScore;
1610
+ type index$p_CategoricalScoreV1 = CategoricalScoreV1;
1611
+ type index$p_Comment = Comment;
1612
+ declare const index$p_CommentObjectType: typeof CommentObjectType;
1613
+ type index$p_ConfigCategory = ConfigCategory;
1614
+ type index$p_CorrectionScore = CorrectionScore;
1615
+ type index$p_CreateScoreValue = CreateScoreValue;
1616
+ type index$p_Dataset = Dataset;
1617
+ type index$p_DatasetItem = DatasetItem;
1618
+ type index$p_DatasetRun = DatasetRun;
1619
+ type index$p_DatasetRunItem = DatasetRunItem;
1620
+ type index$p_DatasetRunWithItems = DatasetRunWithItems;
1621
+ declare const index$p_DatasetStatus: typeof DatasetStatus;
1622
+ type index$p_MapValue = MapValue;
1623
+ type index$p_MethodNotAllowedError = MethodNotAllowedError;
1624
+ declare const index$p_MethodNotAllowedError: typeof MethodNotAllowedError;
1625
+ type index$p_Model = Model;
1626
+ type index$p_ModelPrice = ModelPrice;
1627
+ declare const index$p_ModelUsageUnit: typeof ModelUsageUnit;
1628
+ type index$p_NotFoundError = NotFoundError;
1629
+ declare const index$p_NotFoundError: typeof NotFoundError;
1630
+ type index$p_NumericScore = NumericScore;
1631
+ type index$p_NumericScoreV1 = NumericScoreV1;
1632
+ type index$p_Observation = Observation;
1633
+ declare const index$p_ObservationLevel: typeof ObservationLevel;
1634
+ type index$p_ObservationsView = ObservationsView;
1635
+ type index$p_PricingTier = PricingTier;
1636
+ type index$p_PricingTierCondition = PricingTierCondition;
1637
+ type index$p_PricingTierInput = PricingTierInput;
1638
+ declare const index$p_PricingTierOperator: typeof PricingTierOperator;
1639
+ type index$p_ScoreConfig = ScoreConfig;
1640
+ declare const index$p_ScoreConfigDataType: typeof ScoreConfigDataType;
1641
+ declare const index$p_ScoreDataType: typeof ScoreDataType;
1642
+ declare const index$p_ScoreSource: typeof ScoreSource;
1643
+ declare const index$p_ScoreV1: typeof ScoreV1;
1644
+ type index$p_Session = Session;
1645
+ type index$p_SessionWithTraces = SessionWithTraces;
1646
+ type index$p_TraceWithDetails = TraceWithDetails;
1647
+ type index$p_TraceWithFullDetails = TraceWithFullDetails;
1648
+ type index$p_UnauthorizedError = UnauthorizedError;
1649
+ declare const index$p_UnauthorizedError: typeof UnauthorizedError;
1650
+ type index$p_Usage = Usage;
1651
+ declare namespace index$p {
1652
+ export { index$p_AccessDeniedError as AccessDeniedError, type index$p_BaseScore as BaseScore, type index$p_BaseScoreV1 as BaseScoreV1, type index$p_BooleanScore as BooleanScore, type index$p_BooleanScoreV1 as BooleanScoreV1, type index$p_CategoricalScore as CategoricalScore, type index$p_CategoricalScoreV1 as CategoricalScoreV1, type index$p_Comment as Comment, index$p_CommentObjectType as CommentObjectType, type index$p_ConfigCategory as ConfigCategory, type index$p_CorrectionScore as CorrectionScore, type index$p_CreateScoreValue as CreateScoreValue, type index$p_Dataset as Dataset, type index$p_DatasetItem as DatasetItem, type index$p_DatasetRun as DatasetRun, type index$p_DatasetRunItem as DatasetRunItem, type index$p_DatasetRunWithItems as DatasetRunWithItems, index$p_DatasetStatus as DatasetStatus, Error$1 as Error, type index$p_MapValue as MapValue, index$p_MethodNotAllowedError as MethodNotAllowedError, type index$p_Model as Model, type index$p_ModelPrice as ModelPrice, index$p_ModelUsageUnit as ModelUsageUnit, index$p_NotFoundError as NotFoundError, type index$p_NumericScore as NumericScore, type index$p_NumericScoreV1 as NumericScoreV1, type index$p_Observation as Observation, index$p_ObservationLevel as ObservationLevel, type index$p_ObservationsView as ObservationsView, type index$p_PricingTier as PricingTier, type index$p_PricingTierCondition as PricingTierCondition, type index$p_PricingTierInput as PricingTierInput, index$p_PricingTierOperator as PricingTierOperator, Score$1 as Score, type index$p_ScoreConfig as ScoreConfig, index$p_ScoreConfigDataType as ScoreConfigDataType, index$p_ScoreDataType as ScoreDataType, index$p_ScoreSource as ScoreSource, index$p_ScoreV1 as ScoreV1, type index$p_Session as Session, type index$p_SessionWithTraces as SessionWithTraces, type Trace$1 as Trace, type index$p_TraceWithDetails as TraceWithDetails, type index$p_TraceWithFullDetails as TraceWithFullDetails, index$p_UnauthorizedError as UnauthorizedError, type index$p_Usage as Usage };
1587
1653
  }
1588
1654
 
1589
1655
  /**
@@ -1631,18 +1697,24 @@ interface GetDatasetItemsRequest {
1631
1697
  datasetName?: string;
1632
1698
  sourceTraceId?: string;
1633
1699
  sourceObservationId?: string;
1700
+ /**
1701
+ * ISO 8601 timestamp (RFC 3339, Section 5.6) in UTC (e.g., "2026-01-21T14:35:42Z").
1702
+ * If provided, returns state of dataset at this timestamp.
1703
+ * If not provided, returns the latest version. Requires datasetName to be specified.
1704
+ */
1705
+ version?: string;
1634
1706
  /** page number, starts at 1 */
1635
1707
  page?: number;
1636
1708
  /** limit of items per page */
1637
1709
  limit?: number;
1638
1710
  }
1639
1711
 
1640
- type index$m_CreateDatasetItemRequest = CreateDatasetItemRequest;
1641
- type index$m_DeleteDatasetItemResponse = DeleteDatasetItemResponse;
1642
- type index$m_GetDatasetItemsRequest = GetDatasetItemsRequest;
1643
- type index$m_PaginatedDatasetItems = PaginatedDatasetItems;
1644
- declare namespace index$m {
1645
- export type { index$m_CreateDatasetItemRequest as CreateDatasetItemRequest, index$m_DeleteDatasetItemResponse as DeleteDatasetItemResponse, index$m_GetDatasetItemsRequest as GetDatasetItemsRequest, index$m_PaginatedDatasetItems as PaginatedDatasetItems };
1712
+ type index$o_CreateDatasetItemRequest = CreateDatasetItemRequest;
1713
+ type index$o_DeleteDatasetItemResponse = DeleteDatasetItemResponse;
1714
+ type index$o_GetDatasetItemsRequest = GetDatasetItemsRequest;
1715
+ type index$o_PaginatedDatasetItems = PaginatedDatasetItems;
1716
+ declare namespace index$o {
1717
+ export type { index$o_CreateDatasetItemRequest as CreateDatasetItemRequest, index$o_DeleteDatasetItemResponse as DeleteDatasetItemResponse, index$o_GetDatasetItemsRequest as GetDatasetItemsRequest, index$o_PaginatedDatasetItems as PaginatedDatasetItems };
1646
1718
  }
1647
1719
 
1648
1720
  /**
@@ -1658,6 +1730,13 @@ interface CreateDatasetRunItemRequest {
1658
1730
  observationId?: string;
1659
1731
  /** traceId should always be provided. For compatibility with older SDK versions it can also be inferred from the provided observationId. */
1660
1732
  traceId?: string;
1733
+ /**
1734
+ * ISO 8601 timestamp (RFC 3339, Section 5.6) in UTC (e.g., "2026-01-21T14:35:42Z").
1735
+ * Specifies the dataset version to use for this experiment run.
1736
+ * If provided, the experiment will use dataset items as they existed at or before this timestamp.
1737
+ * If not provided, uses the latest version of dataset items.
1738
+ */
1739
+ datasetVersion?: string;
1661
1740
  }
1662
1741
 
1663
1742
  /**
@@ -1688,11 +1767,11 @@ interface ListDatasetRunItemsRequest {
1688
1767
  limit?: number;
1689
1768
  }
1690
1769
 
1691
- type index$l_CreateDatasetRunItemRequest = CreateDatasetRunItemRequest;
1692
- type index$l_ListDatasetRunItemsRequest = ListDatasetRunItemsRequest;
1693
- type index$l_PaginatedDatasetRunItems = PaginatedDatasetRunItems;
1694
- declare namespace index$l {
1695
- export type { index$l_CreateDatasetRunItemRequest as CreateDatasetRunItemRequest, index$l_ListDatasetRunItemsRequest as ListDatasetRunItemsRequest, index$l_PaginatedDatasetRunItems as PaginatedDatasetRunItems };
1770
+ type index$n_CreateDatasetRunItemRequest = CreateDatasetRunItemRequest;
1771
+ type index$n_ListDatasetRunItemsRequest = ListDatasetRunItemsRequest;
1772
+ type index$n_PaginatedDatasetRunItems = PaginatedDatasetRunItems;
1773
+ declare namespace index$n {
1774
+ export type { index$n_CreateDatasetRunItemRequest as CreateDatasetRunItemRequest, index$n_ListDatasetRunItemsRequest as ListDatasetRunItemsRequest, index$n_PaginatedDatasetRunItems as PaginatedDatasetRunItems };
1696
1775
  }
1697
1776
 
1698
1777
  /**
@@ -1761,14 +1840,14 @@ interface GetDatasetRunsRequest {
1761
1840
  limit?: number;
1762
1841
  }
1763
1842
 
1764
- type index$k_CreateDatasetRequest = CreateDatasetRequest;
1765
- type index$k_DeleteDatasetRunResponse = DeleteDatasetRunResponse;
1766
- type index$k_GetDatasetRunsRequest = GetDatasetRunsRequest;
1767
- type index$k_GetDatasetsRequest = GetDatasetsRequest;
1768
- type index$k_PaginatedDatasetRuns = PaginatedDatasetRuns;
1769
- type index$k_PaginatedDatasets = PaginatedDatasets;
1770
- declare namespace index$k {
1771
- export type { index$k_CreateDatasetRequest as CreateDatasetRequest, index$k_DeleteDatasetRunResponse as DeleteDatasetRunResponse, index$k_GetDatasetRunsRequest as GetDatasetRunsRequest, index$k_GetDatasetsRequest as GetDatasetsRequest, index$k_PaginatedDatasetRuns as PaginatedDatasetRuns, index$k_PaginatedDatasets as PaginatedDatasets };
1843
+ type index$m_CreateDatasetRequest = CreateDatasetRequest;
1844
+ type index$m_DeleteDatasetRunResponse = DeleteDatasetRunResponse;
1845
+ type index$m_GetDatasetRunsRequest = GetDatasetRunsRequest;
1846
+ type index$m_GetDatasetsRequest = GetDatasetsRequest;
1847
+ type index$m_PaginatedDatasetRuns = PaginatedDatasetRuns;
1848
+ type index$m_PaginatedDatasets = PaginatedDatasets;
1849
+ declare namespace index$m {
1850
+ export type { index$m_CreateDatasetRequest as CreateDatasetRequest, index$m_DeleteDatasetRunResponse as DeleteDatasetRunResponse, index$m_GetDatasetRunsRequest as GetDatasetRunsRequest, index$m_GetDatasetsRequest as GetDatasetsRequest, index$m_PaginatedDatasetRuns as PaginatedDatasetRuns, index$m_PaginatedDatasets as PaginatedDatasets };
1772
1851
  }
1773
1852
 
1774
1853
  /**
@@ -1795,11 +1874,11 @@ declare class ServiceUnavailableError extends LangfuseAPIError {
1795
1874
  constructor(rawResponse?: RawResponse);
1796
1875
  }
1797
1876
 
1798
- type index$j_HealthResponse = HealthResponse;
1799
- type index$j_ServiceUnavailableError = ServiceUnavailableError;
1800
- declare const index$j_ServiceUnavailableError: typeof ServiceUnavailableError;
1801
- declare namespace index$j {
1802
- export { type index$j_HealthResponse as HealthResponse, index$j_ServiceUnavailableError as ServiceUnavailableError };
1877
+ type index$l_HealthResponse = HealthResponse;
1878
+ type index$l_ServiceUnavailableError = ServiceUnavailableError;
1879
+ declare const index$l_ServiceUnavailableError: typeof ServiceUnavailableError;
1880
+ declare namespace index$l {
1881
+ export { type index$l_HealthResponse as HealthResponse, index$l_ServiceUnavailableError as ServiceUnavailableError };
1803
1882
  }
1804
1883
 
1805
1884
  /**
@@ -2119,6 +2198,7 @@ interface ScoreBody {
2119
2198
  sessionId?: string;
2120
2199
  observationId?: string;
2121
2200
  datasetRunId?: string;
2201
+ /** The name of the score. Always overrides "output" for correction scores. */
2122
2202
  name: string;
2123
2203
  environment?: string;
2124
2204
  /** The annotation queue referenced by the score. Indicates if score was initially created while processing annotation queue. */
@@ -2353,41 +2433,41 @@ interface IngestionRequest {
2353
2433
  metadata?: unknown;
2354
2434
  }
2355
2435
 
2356
- type index$i_BaseEvent = BaseEvent;
2357
- type index$i_CreateEventBody = CreateEventBody;
2358
- type index$i_CreateEventEvent = CreateEventEvent;
2359
- type index$i_CreateGenerationBody = CreateGenerationBody;
2360
- type index$i_CreateGenerationEvent = CreateGenerationEvent;
2361
- type index$i_CreateObservationEvent = CreateObservationEvent;
2362
- type index$i_CreateSpanBody = CreateSpanBody;
2363
- type index$i_CreateSpanEvent = CreateSpanEvent;
2364
- type index$i_IngestionError = IngestionError;
2365
- declare const index$i_IngestionEvent: typeof IngestionEvent;
2366
- type index$i_IngestionRequest = IngestionRequest;
2367
- type index$i_IngestionResponse = IngestionResponse;
2368
- type index$i_IngestionSuccess = IngestionSuccess;
2369
- type index$i_IngestionUsage = IngestionUsage;
2370
- type index$i_ObservationBody = ObservationBody;
2371
- declare const index$i_ObservationType: typeof ObservationType;
2372
- type index$i_OpenAiCompletionUsageSchema = OpenAiCompletionUsageSchema;
2373
- type index$i_OpenAiResponseUsageSchema = OpenAiResponseUsageSchema;
2374
- type index$i_OpenAiUsage = OpenAiUsage;
2375
- type index$i_OptionalObservationBody = OptionalObservationBody;
2376
- type index$i_ScoreBody = ScoreBody;
2377
- type index$i_ScoreEvent = ScoreEvent;
2378
- type index$i_SdkLogBody = SdkLogBody;
2379
- type index$i_SdkLogEvent = SdkLogEvent;
2380
- type index$i_TraceBody = TraceBody;
2381
- type index$i_TraceEvent = TraceEvent;
2382
- type index$i_UpdateEventBody = UpdateEventBody;
2383
- type index$i_UpdateGenerationBody = UpdateGenerationBody;
2384
- type index$i_UpdateGenerationEvent = UpdateGenerationEvent;
2385
- type index$i_UpdateObservationEvent = UpdateObservationEvent;
2386
- type index$i_UpdateSpanBody = UpdateSpanBody;
2387
- type index$i_UpdateSpanEvent = UpdateSpanEvent;
2388
- type index$i_UsageDetails = UsageDetails;
2389
- declare namespace index$i {
2390
- export { type index$i_BaseEvent as BaseEvent, type index$i_CreateEventBody as CreateEventBody, type index$i_CreateEventEvent as CreateEventEvent, type index$i_CreateGenerationBody as CreateGenerationBody, type index$i_CreateGenerationEvent as CreateGenerationEvent, type index$i_CreateObservationEvent as CreateObservationEvent, type index$i_CreateSpanBody as CreateSpanBody, type index$i_CreateSpanEvent as CreateSpanEvent, type index$i_IngestionError as IngestionError, index$i_IngestionEvent as IngestionEvent, type index$i_IngestionRequest as IngestionRequest, type index$i_IngestionResponse as IngestionResponse, type index$i_IngestionSuccess as IngestionSuccess, type index$i_IngestionUsage as IngestionUsage, type index$i_ObservationBody as ObservationBody, index$i_ObservationType as ObservationType, type index$i_OpenAiCompletionUsageSchema as OpenAiCompletionUsageSchema, type index$i_OpenAiResponseUsageSchema as OpenAiResponseUsageSchema, type index$i_OpenAiUsage as OpenAiUsage, type index$i_OptionalObservationBody as OptionalObservationBody, type index$i_ScoreBody as ScoreBody, type index$i_ScoreEvent as ScoreEvent, type index$i_SdkLogBody as SdkLogBody, type index$i_SdkLogEvent as SdkLogEvent, type index$i_TraceBody as TraceBody, type index$i_TraceEvent as TraceEvent, type index$i_UpdateEventBody as UpdateEventBody, type index$i_UpdateGenerationBody as UpdateGenerationBody, type index$i_UpdateGenerationEvent as UpdateGenerationEvent, type index$i_UpdateObservationEvent as UpdateObservationEvent, type index$i_UpdateSpanBody as UpdateSpanBody, type index$i_UpdateSpanEvent as UpdateSpanEvent, type index$i_UsageDetails as UsageDetails };
2436
+ type index$k_BaseEvent = BaseEvent;
2437
+ type index$k_CreateEventBody = CreateEventBody;
2438
+ type index$k_CreateEventEvent = CreateEventEvent;
2439
+ type index$k_CreateGenerationBody = CreateGenerationBody;
2440
+ type index$k_CreateGenerationEvent = CreateGenerationEvent;
2441
+ type index$k_CreateObservationEvent = CreateObservationEvent;
2442
+ type index$k_CreateSpanBody = CreateSpanBody;
2443
+ type index$k_CreateSpanEvent = CreateSpanEvent;
2444
+ type index$k_IngestionError = IngestionError;
2445
+ declare const index$k_IngestionEvent: typeof IngestionEvent;
2446
+ type index$k_IngestionRequest = IngestionRequest;
2447
+ type index$k_IngestionResponse = IngestionResponse;
2448
+ type index$k_IngestionSuccess = IngestionSuccess;
2449
+ type index$k_IngestionUsage = IngestionUsage;
2450
+ type index$k_ObservationBody = ObservationBody;
2451
+ declare const index$k_ObservationType: typeof ObservationType;
2452
+ type index$k_OpenAiCompletionUsageSchema = OpenAiCompletionUsageSchema;
2453
+ type index$k_OpenAiResponseUsageSchema = OpenAiResponseUsageSchema;
2454
+ type index$k_OpenAiUsage = OpenAiUsage;
2455
+ type index$k_OptionalObservationBody = OptionalObservationBody;
2456
+ type index$k_ScoreBody = ScoreBody;
2457
+ type index$k_ScoreEvent = ScoreEvent;
2458
+ type index$k_SdkLogBody = SdkLogBody;
2459
+ type index$k_SdkLogEvent = SdkLogEvent;
2460
+ type index$k_TraceBody = TraceBody;
2461
+ type index$k_TraceEvent = TraceEvent;
2462
+ type index$k_UpdateEventBody = UpdateEventBody;
2463
+ type index$k_UpdateGenerationBody = UpdateGenerationBody;
2464
+ type index$k_UpdateGenerationEvent = UpdateGenerationEvent;
2465
+ type index$k_UpdateObservationEvent = UpdateObservationEvent;
2466
+ type index$k_UpdateSpanBody = UpdateSpanBody;
2467
+ type index$k_UpdateSpanEvent = UpdateSpanEvent;
2468
+ type index$k_UsageDetails = UsageDetails;
2469
+ declare namespace index$k {
2470
+ export { type index$k_BaseEvent as BaseEvent, type index$k_CreateEventBody as CreateEventBody, type index$k_CreateEventEvent as CreateEventEvent, type index$k_CreateGenerationBody as CreateGenerationBody, type index$k_CreateGenerationEvent as CreateGenerationEvent, type index$k_CreateObservationEvent as CreateObservationEvent, type index$k_CreateSpanBody as CreateSpanBody, type index$k_CreateSpanEvent as CreateSpanEvent, type index$k_IngestionError as IngestionError, index$k_IngestionEvent as IngestionEvent, type index$k_IngestionRequest as IngestionRequest, type index$k_IngestionResponse as IngestionResponse, type index$k_IngestionSuccess as IngestionSuccess, type index$k_IngestionUsage as IngestionUsage, type index$k_ObservationBody as ObservationBody, index$k_ObservationType as ObservationType, type index$k_OpenAiCompletionUsageSchema as OpenAiCompletionUsageSchema, type index$k_OpenAiResponseUsageSchema as OpenAiResponseUsageSchema, type index$k_OpenAiUsage as OpenAiUsage, type index$k_OptionalObservationBody as OptionalObservationBody, type index$k_ScoreBody as ScoreBody, type index$k_ScoreEvent as ScoreEvent, type index$k_SdkLogBody as SdkLogBody, type index$k_SdkLogEvent as SdkLogEvent, type index$k_TraceBody as TraceBody, type index$k_TraceEvent as TraceEvent, type index$k_UpdateEventBody as UpdateEventBody, type index$k_UpdateGenerationBody as UpdateGenerationBody, type index$k_UpdateGenerationEvent as UpdateGenerationEvent, type index$k_UpdateObservationEvent as UpdateObservationEvent, type index$k_UpdateSpanBody as UpdateSpanBody, type index$k_UpdateSpanEvent as UpdateSpanEvent, type index$k_UsageDetails as UsageDetails };
2391
2471
  }
2392
2472
 
2393
2473
  /**
@@ -2480,13 +2560,13 @@ interface GetLlmConnectionsRequest {
2480
2560
  limit?: number;
2481
2561
  }
2482
2562
 
2483
- type index$h_GetLlmConnectionsRequest = GetLlmConnectionsRequest;
2484
- declare const index$h_LlmAdapter: typeof LlmAdapter;
2485
- type index$h_LlmConnection = LlmConnection;
2486
- type index$h_PaginatedLlmConnections = PaginatedLlmConnections;
2487
- type index$h_UpsertLlmConnectionRequest = UpsertLlmConnectionRequest;
2488
- declare namespace index$h {
2489
- export { type index$h_GetLlmConnectionsRequest as GetLlmConnectionsRequest, index$h_LlmAdapter as LlmAdapter, type index$h_LlmConnection as LlmConnection, type index$h_PaginatedLlmConnections as PaginatedLlmConnections, type index$h_UpsertLlmConnectionRequest as UpsertLlmConnectionRequest };
2563
+ type index$j_GetLlmConnectionsRequest = GetLlmConnectionsRequest;
2564
+ declare const index$j_LlmAdapter: typeof LlmAdapter;
2565
+ type index$j_LlmConnection = LlmConnection;
2566
+ type index$j_PaginatedLlmConnections = PaginatedLlmConnections;
2567
+ type index$j_UpsertLlmConnectionRequest = UpsertLlmConnectionRequest;
2568
+ declare namespace index$j {
2569
+ export { type index$j_GetLlmConnectionsRequest as GetLlmConnectionsRequest, index$j_LlmAdapter as LlmAdapter, type index$j_LlmConnection as LlmConnection, type index$j_PaginatedLlmConnections as PaginatedLlmConnections, type index$j_UpsertLlmConnectionRequest as UpsertLlmConnectionRequest };
2490
2570
  }
2491
2571
 
2492
2572
  /**
@@ -2611,13 +2691,95 @@ declare const MediaContentType: {
2611
2691
  readonly ApplicationX7ZCompressed: "application/x-7z-compressed";
2612
2692
  };
2613
2693
 
2614
- type index$g_GetMediaResponse = GetMediaResponse;
2615
- type index$g_GetMediaUploadUrlRequest = GetMediaUploadUrlRequest;
2616
- type index$g_GetMediaUploadUrlResponse = GetMediaUploadUrlResponse;
2617
- declare const index$g_MediaContentType: typeof MediaContentType;
2618
- type index$g_PatchMediaBody = PatchMediaBody;
2619
- declare namespace index$g {
2620
- export { type index$g_GetMediaResponse as GetMediaResponse, type index$g_GetMediaUploadUrlRequest as GetMediaUploadUrlRequest, type index$g_GetMediaUploadUrlResponse as GetMediaUploadUrlResponse, index$g_MediaContentType as MediaContentType, type index$g_PatchMediaBody as PatchMediaBody };
2694
+ type index$i_GetMediaResponse = GetMediaResponse;
2695
+ type index$i_GetMediaUploadUrlRequest = GetMediaUploadUrlRequest;
2696
+ type index$i_GetMediaUploadUrlResponse = GetMediaUploadUrlResponse;
2697
+ declare const index$i_MediaContentType: typeof MediaContentType;
2698
+ type index$i_PatchMediaBody = PatchMediaBody;
2699
+ declare namespace index$i {
2700
+ export { type index$i_GetMediaResponse as GetMediaResponse, type index$i_GetMediaUploadUrlRequest as GetMediaUploadUrlRequest, type index$i_GetMediaUploadUrlResponse as GetMediaUploadUrlResponse, index$i_MediaContentType as MediaContentType, type index$i_PatchMediaBody as PatchMediaBody };
2701
+ }
2702
+
2703
+ /**
2704
+ * This file was auto-generated by Fern from our API Definition.
2705
+ */
2706
+ interface MetricsV2Response {
2707
+ /**
2708
+ * The metrics data. Each item in the list contains the metric values and dimensions requested in the query.
2709
+ * Format varies based on the query parameters.
2710
+ * Histograms will return an array with [lower, upper, height] tuples.
2711
+ */
2712
+ data: Record<string, unknown>[];
2713
+ }
2714
+
2715
+ /**
2716
+ * This file was auto-generated by Fern from our API Definition.
2717
+ */
2718
+ /**
2719
+ * @example
2720
+ * {
2721
+ * query: "query"
2722
+ * }
2723
+ */
2724
+ interface GetMetricsV2Request {
2725
+ /**
2726
+ * JSON string containing the query parameters with the following structure:
2727
+ * ```json
2728
+ * {
2729
+ * "view": string, // Required. One of "observations", "scores-numeric", "scores-categorical"
2730
+ * "dimensions": [ // Optional. Default: []
2731
+ * {
2732
+ * "field": string // Field to group by (see available dimensions above)
2733
+ * }
2734
+ * ],
2735
+ * "metrics": [ // Required. At least one metric must be provided
2736
+ * {
2737
+ * "measure": string, // What to measure (see available measures above)
2738
+ * "aggregation": string // How to aggregate: "sum", "avg", "count", "max", "min", "p50", "p75", "p90", "p95", "p99", "histogram"
2739
+ * }
2740
+ * ],
2741
+ * "filters": [ // Optional. Default: []
2742
+ * {
2743
+ * "column": string, // Column to filter on (any dimension field)
2744
+ * "operator": string, // Operator based on type:
2745
+ * // - datetime: ">", "<", ">=", "<="
2746
+ * // - string: "=", "contains", "does not contain", "starts with", "ends with"
2747
+ * // - stringOptions: "any of", "none of"
2748
+ * // - arrayOptions: "any of", "none of", "all of"
2749
+ * // - number: "=", ">", "<", ">=", "<="
2750
+ * // - stringObject/numberObject: same as string/number with required "key"
2751
+ * // - boolean: "=", "<>"
2752
+ * // - null: "is null", "is not null"
2753
+ * "value": any, // Value to compare against
2754
+ * "type": string, // Data type: "datetime", "string", "number", "stringOptions", "categoryOptions", "arrayOptions", "stringObject", "numberObject", "boolean", "null"
2755
+ * "key": string // Required only for stringObject/numberObject types (e.g., metadata filtering)
2756
+ * }
2757
+ * ],
2758
+ * "timeDimension": { // Optional. Default: null. If provided, results will be grouped by time
2759
+ * "granularity": string // One of "auto", "minute", "hour", "day", "week", "month"
2760
+ * },
2761
+ * "fromTimestamp": string, // Required. ISO datetime string for start of time range
2762
+ * "toTimestamp": string, // Required. ISO datetime string for end of time range (must be after fromTimestamp)
2763
+ * "orderBy": [ // Optional. Default: null
2764
+ * {
2765
+ * "field": string, // Field to order by (dimension or metric alias)
2766
+ * "direction": string // "asc" or "desc"
2767
+ * }
2768
+ * ],
2769
+ * "config": { // Optional. Query-specific configuration
2770
+ * "bins": number, // Optional. Number of bins for histogram aggregation (1-100), default: 10
2771
+ * "row_limit": number // Optional. Maximum number of rows to return (1-1000), default: 100
2772
+ * }
2773
+ * }
2774
+ * ```
2775
+ */
2776
+ query: string;
2777
+ }
2778
+
2779
+ type index$h_GetMetricsV2Request = GetMetricsV2Request;
2780
+ type index$h_MetricsV2Response = MetricsV2Response;
2781
+ declare namespace index$h {
2782
+ export type { index$h_GetMetricsV2Request as GetMetricsV2Request, index$h_MetricsV2Response as MetricsV2Response };
2621
2783
  }
2622
2784
 
2623
2785
  /**
@@ -2688,10 +2850,10 @@ interface GetMetricsRequest {
2688
2850
  query: string;
2689
2851
  }
2690
2852
 
2691
- type index$f_GetMetricsRequest = GetMetricsRequest;
2692
- type index$f_MetricsResponse = MetricsResponse;
2693
- declare namespace index$f {
2694
- export type { index$f_GetMetricsRequest as GetMetricsRequest, index$f_MetricsResponse as MetricsResponse };
2853
+ type index$g_GetMetricsRequest = GetMetricsRequest;
2854
+ type index$g_MetricsResponse = MetricsResponse;
2855
+ declare namespace index$g {
2856
+ export type { index$g_GetMetricsRequest as GetMetricsRequest, index$g_MetricsResponse as MetricsResponse };
2695
2857
  }
2696
2858
 
2697
2859
  /**
@@ -2763,11 +2925,192 @@ interface GetModelsRequest {
2763
2925
  limit?: number;
2764
2926
  }
2765
2927
 
2766
- type index$e_CreateModelRequest = CreateModelRequest;
2767
- type index$e_GetModelsRequest = GetModelsRequest;
2768
- type index$e_PaginatedModels = PaginatedModels;
2928
+ type index$f_CreateModelRequest = CreateModelRequest;
2929
+ type index$f_GetModelsRequest = GetModelsRequest;
2930
+ type index$f_PaginatedModels = PaginatedModels;
2931
+ declare namespace index$f {
2932
+ export type { index$f_CreateModelRequest as CreateModelRequest, index$f_GetModelsRequest as GetModelsRequest, index$f_PaginatedModels as PaginatedModels };
2933
+ }
2934
+
2935
+ /**
2936
+ * This file was auto-generated by Fern from our API Definition.
2937
+ */
2938
+
2939
+ /**
2940
+ * Response containing observations with field-group-based filtering and cursor-based pagination.
2941
+ *
2942
+ * The `data` array contains observation objects with only the requested field groups included.
2943
+ * Use the `cursor` in `meta` to retrieve the next page of results.
2944
+ */
2945
+ interface ObservationsV2Response {
2946
+ /** Array of observation objects. Fields included depend on the `fields` parameter in the request. */
2947
+ data: Record<string, unknown>[];
2948
+ meta: ObservationsV2Meta;
2949
+ }
2950
+
2951
+ /**
2952
+ * This file was auto-generated by Fern from our API Definition.
2953
+ */
2954
+ /**
2955
+ * Metadata for cursor-based pagination
2956
+ */
2957
+ interface ObservationsV2Meta {
2958
+ /** Base64-encoded cursor to use for retrieving the next page. If not present, there are no more results. */
2959
+ cursor?: string;
2960
+ }
2961
+
2962
+ /**
2963
+ * This file was auto-generated by Fern from our API Definition.
2964
+ */
2965
+
2966
+ /**
2967
+ * @example
2968
+ * {}
2969
+ */
2970
+ interface GetObservationsV2Request {
2971
+ /**
2972
+ * Comma-separated list of field groups to include in the response.
2973
+ * Available groups: core, basic, time, io, metadata, model, usage, prompt, metrics.
2974
+ * If not specified, `core` and `basic` field groups are returned.
2975
+ * Example: "basic,usage,model"
2976
+ */
2977
+ fields?: string;
2978
+ /**
2979
+ * Comma-separated list of metadata keys to return non-truncated.
2980
+ * By default, metadata values over 200 characters are truncated.
2981
+ * Use this parameter to retrieve full values for specific keys.
2982
+ * Example: "key1,key2"
2983
+ */
2984
+ expandMetadata?: string;
2985
+ /** Number of items to return per page. Maximum 1000, default 50. */
2986
+ limit?: number;
2987
+ /** Base64-encoded cursor for pagination. Use the cursor from the previous response to get the next page. */
2988
+ cursor?: string;
2989
+ /**
2990
+ * Set to `true` to parse input/output fields as JSON, or `false` to return raw strings.
2991
+ * Defaults to `false` if not provided.
2992
+ */
2993
+ parseIoAsJson?: boolean;
2994
+ name?: string;
2995
+ userId?: string;
2996
+ /** Filter by observation type (e.g., "GENERATION", "SPAN", "EVENT", "AGENT", "TOOL", "CHAIN", "RETRIEVER", "EVALUATOR", "EMBEDDING", "GUARDRAIL") */
2997
+ type?: string;
2998
+ traceId?: string;
2999
+ /** Optional filter for observations with a specific level (e.g. "DEBUG", "DEFAULT", "WARNING", "ERROR"). */
3000
+ level?: ObservationLevel;
3001
+ parentObservationId?: string;
3002
+ /** Optional filter for observations where the environment is one of the provided values. */
3003
+ environment?: string | string[];
3004
+ /** Retrieve only observations with a start_time on or after this datetime (ISO 8601). */
3005
+ fromStartTime?: string;
3006
+ /** Retrieve only observations with a start_time before this datetime (ISO 8601). */
3007
+ toStartTime?: string;
3008
+ /** Optional filter to only include observations with a certain version. */
3009
+ version?: string;
3010
+ /**
3011
+ * JSON string containing an array of filter conditions. When provided, this takes precedence over query parameter filters (userId, name, type, level, environment, fromStartTime, ...).
3012
+ *
3013
+ * ## Filter Structure
3014
+ * Each filter condition has the following structure:
3015
+ * ```json
3016
+ * [
3017
+ * {
3018
+ * "type": string, // Required. One of: "datetime", "string", "number", "stringOptions", "categoryOptions", "arrayOptions", "stringObject", "numberObject", "boolean", "null"
3019
+ * "column": string, // Required. Column to filter on (see available columns below)
3020
+ * "operator": string, // Required. Operator based on type:
3021
+ * // - datetime: ">", "<", ">=", "<="
3022
+ * // - string: "=", "contains", "does not contain", "starts with", "ends with"
3023
+ * // - stringOptions: "any of", "none of"
3024
+ * // - categoryOptions: "any of", "none of"
3025
+ * // - arrayOptions: "any of", "none of", "all of"
3026
+ * // - number: "=", ">", "<", ">=", "<="
3027
+ * // - stringObject: "=", "contains", "does not contain", "starts with", "ends with"
3028
+ * // - numberObject: "=", ">", "<", ">=", "<="
3029
+ * // - boolean: "=", "<>"
3030
+ * // - null: "is null", "is not null"
3031
+ * "value": any, // Required (except for null type). Value to compare against. Type depends on filter type
3032
+ * "key": string // Required only for stringObject, numberObject, and categoryOptions types when filtering on nested fields like metadata
3033
+ * }
3034
+ * ]
3035
+ * ```
3036
+ *
3037
+ * ## Available Columns
3038
+ *
3039
+ * ### Core Observation Fields
3040
+ * - `id` (string) - Observation ID
3041
+ * - `type` (string) - Observation type (SPAN, GENERATION, EVENT)
3042
+ * - `name` (string) - Observation name
3043
+ * - `traceId` (string) - Associated trace ID
3044
+ * - `startTime` (datetime) - Observation start time
3045
+ * - `endTime` (datetime) - Observation end time
3046
+ * - `environment` (string) - Environment tag
3047
+ * - `level` (string) - Log level (DEBUG, DEFAULT, WARNING, ERROR)
3048
+ * - `statusMessage` (string) - Status message
3049
+ * - `version` (string) - Version tag
3050
+ * - `userId` (string) - User ID
3051
+ * - `sessionId` (string) - Session ID
3052
+ *
3053
+ * ### Trace-Related Fields
3054
+ * - `traceName` (string) - Name of the parent trace
3055
+ * - `traceTags` (arrayOptions) - Tags from the parent trace
3056
+ * - `tags` (arrayOptions) - Alias for traceTags
3057
+ *
3058
+ * ### Performance Metrics
3059
+ * - `latency` (number) - Latency in seconds (calculated: end_time - start_time)
3060
+ * - `timeToFirstToken` (number) - Time to first token in seconds
3061
+ * - `tokensPerSecond` (number) - Output tokens per second
3062
+ *
3063
+ * ### Token Usage
3064
+ * - `inputTokens` (number) - Number of input tokens
3065
+ * - `outputTokens` (number) - Number of output tokens
3066
+ * - `totalTokens` (number) - Total tokens (alias: `tokens`)
3067
+ *
3068
+ * ### Cost Metrics
3069
+ * - `inputCost` (number) - Input cost in USD
3070
+ * - `outputCost` (number) - Output cost in USD
3071
+ * - `totalCost` (number) - Total cost in USD
3072
+ *
3073
+ * ### Model Information
3074
+ * - `model` (string) - Provided model name (alias: `providedModelName`)
3075
+ * - `promptName` (string) - Associated prompt name
3076
+ * - `promptVersion` (number) - Associated prompt version
3077
+ *
3078
+ * ### Structured Data
3079
+ * - `metadata` (stringObject/numberObject/categoryOptions) - Metadata key-value pairs. Use `key` parameter to filter on specific metadata keys.
3080
+ *
3081
+ * ## Filter Examples
3082
+ * ```json
3083
+ * [
3084
+ * {
3085
+ * "type": "string",
3086
+ * "column": "type",
3087
+ * "operator": "=",
3088
+ * "value": "GENERATION"
3089
+ * },
3090
+ * {
3091
+ * "type": "number",
3092
+ * "column": "latency",
3093
+ * "operator": ">=",
3094
+ * "value": 2.5
3095
+ * },
3096
+ * {
3097
+ * "type": "stringObject",
3098
+ * "column": "metadata",
3099
+ * "key": "environment",
3100
+ * "operator": "=",
3101
+ * "value": "production"
3102
+ * }
3103
+ * ]
3104
+ * ```
3105
+ */
3106
+ filter?: string;
3107
+ }
3108
+
3109
+ type index$e_GetObservationsV2Request = GetObservationsV2Request;
3110
+ type index$e_ObservationsV2Meta = ObservationsV2Meta;
3111
+ type index$e_ObservationsV2Response = ObservationsV2Response;
2769
3112
  declare namespace index$e {
2770
- export type { index$e_CreateModelRequest as CreateModelRequest, index$e_GetModelsRequest as GetModelsRequest, index$e_PaginatedModels as PaginatedModels };
3113
+ export type { index$e_GetObservationsV2Request as GetObservationsV2Request, index$e_ObservationsV2Meta as ObservationsV2Meta, index$e_ObservationsV2Response as ObservationsV2Response };
2771
3114
  }
2772
3115
 
2773
3116
  /**
@@ -3226,9 +3569,22 @@ interface Projects$1 {
3226
3569
  /**
3227
3570
  * This file was auto-generated by Fern from our API Definition.
3228
3571
  */
3572
+ interface Organization {
3573
+ /** The unique identifier of the organization */
3574
+ id: string;
3575
+ /** The name of the organization */
3576
+ name: string;
3577
+ }
3578
+
3579
+ /**
3580
+ * This file was auto-generated by Fern from our API Definition.
3581
+ */
3582
+
3229
3583
  interface Project {
3230
3584
  id: string;
3231
3585
  name: string;
3586
+ /** The organization this project belongs to */
3587
+ organization: Organization;
3232
3588
  /** Metadata for the project */
3233
3589
  metadata: Record<string, unknown>;
3234
3590
  /** Number of days to retain data. Null or 0 means no retention. Omitted if no retention is configured. */
@@ -3322,15 +3678,20 @@ interface CreateProjectRequest {
3322
3678
  * {
3323
3679
  * name: "name",
3324
3680
  * metadata: undefined,
3325
- * retention: 1
3681
+ * retention: undefined
3326
3682
  * }
3327
3683
  */
3328
3684
  interface UpdateProjectRequest {
3329
3685
  name: string;
3330
3686
  /** Optional metadata for the project */
3331
3687
  metadata?: Record<string, unknown>;
3332
- /** Number of days to retain data. Must be 0 or at least 3 days. Requires data-retention entitlement for non-zero values. Optional. */
3333
- retention: number;
3688
+ /**
3689
+ * Number of days to retain data.
3690
+ * Must be 0 or at least 3 days.
3691
+ * Requires data-retention entitlement for non-zero values.
3692
+ * Optional. Will retain existing retention setting if omitted.
3693
+ */
3694
+ retention?: number;
3334
3695
  }
3335
3696
 
3336
3697
  /**
@@ -3359,11 +3720,12 @@ type index$a_ApiKeyResponse = ApiKeyResponse;
3359
3720
  type index$a_ApiKeySummary = ApiKeySummary;
3360
3721
  type index$a_CreateApiKeyRequest = CreateApiKeyRequest;
3361
3722
  type index$a_CreateProjectRequest = CreateProjectRequest;
3723
+ type index$a_Organization = Organization;
3362
3724
  type index$a_Project = Project;
3363
3725
  type index$a_ProjectDeletionResponse = ProjectDeletionResponse;
3364
3726
  type index$a_UpdateProjectRequest = UpdateProjectRequest;
3365
3727
  declare namespace index$a {
3366
- export type { index$a_ApiKeyDeletionResponse as ApiKeyDeletionResponse, index$a_ApiKeyList as ApiKeyList, index$a_ApiKeyResponse as ApiKeyResponse, index$a_ApiKeySummary as ApiKeySummary, index$a_CreateApiKeyRequest as CreateApiKeyRequest, index$a_CreateProjectRequest as CreateProjectRequest, index$a_Project as Project, index$a_ProjectDeletionResponse as ProjectDeletionResponse, Projects$1 as Projects, index$a_UpdateProjectRequest as UpdateProjectRequest };
3728
+ export type { index$a_ApiKeyDeletionResponse as ApiKeyDeletionResponse, index$a_ApiKeyList as ApiKeyList, index$a_ApiKeyResponse as ApiKeyResponse, index$a_ApiKeySummary as ApiKeySummary, index$a_CreateApiKeyRequest as CreateApiKeyRequest, index$a_CreateProjectRequest as CreateProjectRequest, index$a_Organization as Organization, index$a_Project as Project, index$a_ProjectDeletionResponse as ProjectDeletionResponse, Projects$1 as Projects, index$a_UpdateProjectRequest as UpdateProjectRequest };
3367
3729
  }
3368
3730
 
3369
3731
  /**
@@ -3847,7 +4209,7 @@ interface ScoreConfigs$1 {
3847
4209
 
3848
4210
  interface CreateScoreConfigRequest {
3849
4211
  name: string;
3850
- dataType: ScoreDataType;
4212
+ dataType: ScoreConfigDataType;
3851
4213
  /** Configure custom categories for categorical scores. Pass a list of objects with `label` and `value` properties. Categories are autogenerated for boolean configs and cannot be passed */
3852
4214
  categories?: ConfigCategory[];
3853
4215
  /** Configure a minimum value for numerical scores. If not set, the minimum value defaults to -∞ */
@@ -3938,7 +4300,15 @@ interface GetScoresResponseDataBoolean extends BooleanScore {
3938
4300
  * This file was auto-generated by Fern from our API Definition.
3939
4301
  */
3940
4302
 
3941
- type GetScoresResponseData = GetScoresResponseData.Numeric | GetScoresResponseData.Categorical | GetScoresResponseData.Boolean;
4303
+ interface GetScoresResponseDataCorrection extends CorrectionScore {
4304
+ trace?: GetScoresResponseTraceData;
4305
+ }
4306
+
4307
+ /**
4308
+ * This file was auto-generated by Fern from our API Definition.
4309
+ */
4310
+
4311
+ type GetScoresResponseData = GetScoresResponseData.Numeric | GetScoresResponseData.Categorical | GetScoresResponseData.Boolean | GetScoresResponseData.Correction;
3942
4312
  declare namespace GetScoresResponseData {
3943
4313
  interface Numeric extends GetScoresResponseDataNumeric {
3944
4314
  dataType: "NUMERIC";
@@ -3949,6 +4319,9 @@ declare namespace GetScoresResponseData {
3949
4319
  interface Boolean extends GetScoresResponseDataBoolean {
3950
4320
  dataType: "BOOLEAN";
3951
4321
  }
4322
+ interface Correction extends GetScoresResponseDataCorrection {
4323
+ dataType: "CORRECTION";
4324
+ }
3952
4325
  }
3953
4326
 
3954
4327
  /**
@@ -4005,6 +4378,8 @@ interface GetScoresRequest {
4005
4378
  dataType?: ScoreDataType;
4006
4379
  /** Only scores linked to traces that include all of these tags will be returned. */
4007
4380
  traceTags?: string | string[];
4381
+ /** Comma-separated list of field groups to include in the response. Available field groups: 'score' (core score fields), 'trace' (trace properties: userId, tags, environment). If not specified, both 'score' and 'trace' are returned by default. Example: 'score' to exclude trace data, 'score,trace' to include both. Note: When filtering by trace properties (using userId or traceTags parameters), the 'trace' field group must be included, otherwise a 400 error will be returned. */
4382
+ fields?: string;
4008
4383
  }
4009
4384
 
4010
4385
  type index$6_GetScoresRequest = GetScoresRequest;
@@ -4012,10 +4387,11 @@ type index$6_GetScoresResponse = GetScoresResponse;
4012
4387
  declare const index$6_GetScoresResponseData: typeof GetScoresResponseData;
4013
4388
  type index$6_GetScoresResponseDataBoolean = GetScoresResponseDataBoolean;
4014
4389
  type index$6_GetScoresResponseDataCategorical = GetScoresResponseDataCategorical;
4390
+ type index$6_GetScoresResponseDataCorrection = GetScoresResponseDataCorrection;
4015
4391
  type index$6_GetScoresResponseDataNumeric = GetScoresResponseDataNumeric;
4016
4392
  type index$6_GetScoresResponseTraceData = GetScoresResponseTraceData;
4017
4393
  declare namespace index$6 {
4018
- export { type index$6_GetScoresRequest as GetScoresRequest, type index$6_GetScoresResponse as GetScoresResponse, index$6_GetScoresResponseData as GetScoresResponseData, type index$6_GetScoresResponseDataBoolean as GetScoresResponseDataBoolean, type index$6_GetScoresResponseDataCategorical as GetScoresResponseDataCategorical, type index$6_GetScoresResponseDataNumeric as GetScoresResponseDataNumeric, type index$6_GetScoresResponseTraceData as GetScoresResponseTraceData };
4394
+ export { type index$6_GetScoresRequest as GetScoresRequest, type index$6_GetScoresResponse as GetScoresResponse, index$6_GetScoresResponseData as GetScoresResponseData, type index$6_GetScoresResponseDataBoolean as GetScoresResponseDataBoolean, type index$6_GetScoresResponseDataCategorical as GetScoresResponseDataCategorical, type index$6_GetScoresResponseDataCorrection as GetScoresResponseDataCorrection, type index$6_GetScoresResponseDataNumeric as GetScoresResponseDataNumeric, type index$6_GetScoresResponseTraceData as GetScoresResponseTraceData };
4019
4395
  }
4020
4396
 
4021
4397
  /**
@@ -4917,7 +5293,8 @@ declare class DatasetItems {
4917
5293
  get(id: string, requestOptions?: DatasetItems.RequestOptions): HttpResponsePromise<DatasetItem>;
4918
5294
  private __get;
4919
5295
  /**
4920
- * Get dataset items
5296
+ * Get dataset items. Optionally specify a version to get the items as they existed at that point in time.
5297
+ * Note: If version parameter is provided, datasetName must also be provided.
4921
5298
  *
4922
5299
  * @param {LangfuseAPI.GetDatasetItemsRequest} request
4923
5300
  * @param {DatasetItems.RequestOptions} requestOptions - Request-specific configuration.
@@ -5014,7 +5391,8 @@ declare class DatasetRunItems {
5014
5391
  * metadata: undefined,
5015
5392
  * datasetItemId: "datasetItemId",
5016
5393
  * observationId: undefined,
5017
- * traceId: undefined
5394
+ * traceId: undefined,
5395
+ * datasetVersion: undefined
5018
5396
  * })
5019
5397
  */
5020
5398
  create(request: CreateDatasetRunItemRequest, requestOptions?: DatasetRunItems.RequestOptions): HttpResponsePromise<DatasetRunItem>;
@@ -5585,6 +5963,170 @@ declare class Media {
5585
5963
  protected _getAuthorizationHeader(): Promise<string | undefined>;
5586
5964
  }
5587
5965
 
5966
+ /**
5967
+ * This file was auto-generated by Fern from our API Definition.
5968
+ */
5969
+
5970
+ declare namespace MetricsV2 {
5971
+ interface Options {
5972
+ environment: Supplier<string>;
5973
+ /** Specify a custom URL to connect the client to. */
5974
+ baseUrl?: Supplier<string>;
5975
+ username?: Supplier<string | undefined>;
5976
+ password?: Supplier<string | undefined>;
5977
+ /** Override the X-Langfuse-Sdk-Name header */
5978
+ xLangfuseSdkName?: Supplier<string | undefined>;
5979
+ /** Override the X-Langfuse-Sdk-Version header */
5980
+ xLangfuseSdkVersion?: Supplier<string | undefined>;
5981
+ /** Override the X-Langfuse-Public-Key header */
5982
+ xLangfusePublicKey?: Supplier<string | undefined>;
5983
+ /** Additional headers to include in requests. */
5984
+ headers?: Record<string, string | Supplier<string | null | undefined> | null | undefined>;
5985
+ }
5986
+ interface RequestOptions {
5987
+ /** The maximum time to wait for a response in seconds. */
5988
+ timeoutInSeconds?: number;
5989
+ /** The number of times to retry the request. Defaults to 2. */
5990
+ maxRetries?: number;
5991
+ /** A hook to abort the request. */
5992
+ abortSignal?: AbortSignal;
5993
+ /** Override the X-Langfuse-Sdk-Name header */
5994
+ xLangfuseSdkName?: string | undefined;
5995
+ /** Override the X-Langfuse-Sdk-Version header */
5996
+ xLangfuseSdkVersion?: string | undefined;
5997
+ /** Override the X-Langfuse-Public-Key header */
5998
+ xLangfusePublicKey?: string | undefined;
5999
+ /** Additional query string parameters to include in the request. */
6000
+ queryParams?: Record<string, unknown>;
6001
+ /** Additional headers to include in the request. */
6002
+ headers?: Record<string, string | Supplier<string | null | undefined> | null | undefined>;
6003
+ }
6004
+ }
6005
+ declare class MetricsV2 {
6006
+ protected readonly _options: MetricsV2.Options;
6007
+ constructor(_options: MetricsV2.Options);
6008
+ /**
6009
+ * Get metrics from the Langfuse project using a query object. V2 endpoint with optimized performance.
6010
+ *
6011
+ * ## V2 Differences
6012
+ * - Supports `observations`, `scores-numeric`, and `scores-categorical` views only (traces view not supported)
6013
+ * - Direct access to tags and release fields on observations
6014
+ * - Backwards-compatible: traceName, traceRelease, traceVersion dimensions are still available on observations view
6015
+ * - High cardinality dimensions are not supported and will return a 400 error (see below)
6016
+ *
6017
+ * For more details, see the [Metrics API documentation](https://langfuse.com/docs/metrics/features/metrics-api).
6018
+ *
6019
+ * ## Available Views
6020
+ *
6021
+ * ### observations
6022
+ * Query observation-level data (spans, generations, events).
6023
+ *
6024
+ * **Dimensions:**
6025
+ * - `environment` - Deployment environment (e.g., production, staging)
6026
+ * - `type` - Type of observation (SPAN, GENERATION, EVENT)
6027
+ * - `name` - Name of the observation
6028
+ * - `level` - Logging level of the observation
6029
+ * - `version` - Version of the observation
6030
+ * - `tags` - User-defined tags
6031
+ * - `release` - Release version
6032
+ * - `traceName` - Name of the parent trace (backwards-compatible)
6033
+ * - `traceRelease` - Release version of the parent trace (backwards-compatible, maps to release)
6034
+ * - `traceVersion` - Version of the parent trace (backwards-compatible, maps to version)
6035
+ * - `providedModelName` - Name of the model used
6036
+ * - `promptName` - Name of the prompt used
6037
+ * - `promptVersion` - Version of the prompt used
6038
+ * - `startTimeMonth` - Month of start_time in YYYY-MM format
6039
+ *
6040
+ * **Measures:**
6041
+ * - `count` - Total number of observations
6042
+ * - `latency` - Observation latency (milliseconds)
6043
+ * - `streamingLatency` - Generation latency from completion start to end (milliseconds)
6044
+ * - `inputTokens` - Sum of input tokens consumed
6045
+ * - `outputTokens` - Sum of output tokens produced
6046
+ * - `totalTokens` - Sum of all tokens consumed
6047
+ * - `outputTokensPerSecond` - Output tokens per second
6048
+ * - `tokensPerSecond` - Total tokens per second
6049
+ * - `inputCost` - Input cost (USD)
6050
+ * - `outputCost` - Output cost (USD)
6051
+ * - `totalCost` - Total cost (USD)
6052
+ * - `timeToFirstToken` - Time to first token (milliseconds)
6053
+ * - `countScores` - Number of scores attached to the observation
6054
+ *
6055
+ * ### scores-numeric
6056
+ * Query numeric and boolean score data.
6057
+ *
6058
+ * **Dimensions:**
6059
+ * - `environment` - Deployment environment
6060
+ * - `name` - Name of the score (e.g., accuracy, toxicity)
6061
+ * - `source` - Origin of the score (API, ANNOTATION, EVAL)
6062
+ * - `dataType` - Data type (NUMERIC, BOOLEAN)
6063
+ * - `configId` - Identifier of the score config
6064
+ * - `timestampMonth` - Month in YYYY-MM format
6065
+ * - `timestampDay` - Day in YYYY-MM-DD format
6066
+ * - `value` - Numeric value of the score
6067
+ * - `traceName` - Name of the parent trace
6068
+ * - `tags` - Tags
6069
+ * - `traceRelease` - Release version
6070
+ * - `traceVersion` - Version
6071
+ * - `observationName` - Name of the associated observation
6072
+ * - `observationModelName` - Model name of the associated observation
6073
+ * - `observationPromptName` - Prompt name of the associated observation
6074
+ * - `observationPromptVersion` - Prompt version of the associated observation
6075
+ *
6076
+ * **Measures:**
6077
+ * - `count` - Total number of scores
6078
+ * - `value` - Score value (for aggregations)
6079
+ *
6080
+ * ### scores-categorical
6081
+ * Query categorical score data. Same dimensions as scores-numeric except uses `stringValue` instead of `value`.
6082
+ *
6083
+ * **Measures:**
6084
+ * - `count` - Total number of scores
6085
+ *
6086
+ * ## High Cardinality Dimensions
6087
+ * The following dimensions cannot be used as grouping dimensions in v2 metrics API as they can cause performance issues.
6088
+ * Use them in filters instead.
6089
+ *
6090
+ * **observations view:**
6091
+ * - `id` - Use traceId filter to narrow down results
6092
+ * - `traceId` - Use traceId filter instead
6093
+ * - `userId` - Use userId filter instead
6094
+ * - `sessionId` - Use sessionId filter instead
6095
+ * - `parentObservationId` - Use parentObservationId filter instead
6096
+ *
6097
+ * **scores-numeric / scores-categorical views:**
6098
+ * - `id` - Use specific filters to narrow down results
6099
+ * - `traceId` - Use traceId filter instead
6100
+ * - `userId` - Use userId filter instead
6101
+ * - `sessionId` - Use sessionId filter instead
6102
+ * - `observationId` - Use observationId filter instead
6103
+ *
6104
+ * ## Aggregations
6105
+ * Available aggregation functions: `sum`, `avg`, `count`, `max`, `min`, `p50`, `p75`, `p90`, `p95`, `p99`, `histogram`
6106
+ *
6107
+ * ## Time Granularities
6108
+ * Available granularities for timeDimension: `auto`, `minute`, `hour`, `day`, `week`, `month`
6109
+ * - `auto` bins the data into approximately 50 buckets based on the time range
6110
+ *
6111
+ * @param {LangfuseAPI.GetMetricsV2Request} request
6112
+ * @param {MetricsV2.RequestOptions} requestOptions - Request-specific configuration.
6113
+ *
6114
+ * @throws {@link LangfuseAPI.Error}
6115
+ * @throws {@link LangfuseAPI.UnauthorizedError}
6116
+ * @throws {@link LangfuseAPI.AccessDeniedError}
6117
+ * @throws {@link LangfuseAPI.MethodNotAllowedError}
6118
+ * @throws {@link LangfuseAPI.NotFoundError}
6119
+ *
6120
+ * @example
6121
+ * await client.metricsV2.metrics({
6122
+ * query: "query"
6123
+ * })
6124
+ */
6125
+ metrics(request: GetMetricsV2Request, requestOptions?: MetricsV2.RequestOptions): HttpResponsePromise<MetricsV2Response>;
6126
+ private __metrics;
6127
+ protected _getAuthorizationHeader(): Promise<string | undefined>;
6128
+ }
6129
+
5588
6130
  /**
5589
6131
  * This file was auto-generated by Fern from our API Definition.
5590
6132
  */
@@ -5630,6 +6172,8 @@ declare class Metrics {
5630
6172
  /**
5631
6173
  * Get metrics from the Langfuse project using a query object.
5632
6174
  *
6175
+ * Consider using the [v2 metrics endpoint](/api-reference#tag/metricsv2/GET/api/public/v2/metrics) for better performance.
6176
+ *
5633
6177
  * For more details, see the [Metrics API documentation](https://langfuse.com/docs/metrics/features/metrics-api).
5634
6178
  *
5635
6179
  * @param {LangfuseAPI.GetMetricsRequest} request
@@ -5775,6 +6319,91 @@ declare class Models {
5775
6319
  protected _getAuthorizationHeader(): Promise<string | undefined>;
5776
6320
  }
5777
6321
 
6322
+ /**
6323
+ * This file was auto-generated by Fern from our API Definition.
6324
+ */
6325
+
6326
+ declare namespace ObservationsV2 {
6327
+ interface Options {
6328
+ environment: Supplier<string>;
6329
+ /** Specify a custom URL to connect the client to. */
6330
+ baseUrl?: Supplier<string>;
6331
+ username?: Supplier<string | undefined>;
6332
+ password?: Supplier<string | undefined>;
6333
+ /** Override the X-Langfuse-Sdk-Name header */
6334
+ xLangfuseSdkName?: Supplier<string | undefined>;
6335
+ /** Override the X-Langfuse-Sdk-Version header */
6336
+ xLangfuseSdkVersion?: Supplier<string | undefined>;
6337
+ /** Override the X-Langfuse-Public-Key header */
6338
+ xLangfusePublicKey?: Supplier<string | undefined>;
6339
+ /** Additional headers to include in requests. */
6340
+ headers?: Record<string, string | Supplier<string | null | undefined> | null | undefined>;
6341
+ }
6342
+ interface RequestOptions {
6343
+ /** The maximum time to wait for a response in seconds. */
6344
+ timeoutInSeconds?: number;
6345
+ /** The number of times to retry the request. Defaults to 2. */
6346
+ maxRetries?: number;
6347
+ /** A hook to abort the request. */
6348
+ abortSignal?: AbortSignal;
6349
+ /** Override the X-Langfuse-Sdk-Name header */
6350
+ xLangfuseSdkName?: string | undefined;
6351
+ /** Override the X-Langfuse-Sdk-Version header */
6352
+ xLangfuseSdkVersion?: string | undefined;
6353
+ /** Override the X-Langfuse-Public-Key header */
6354
+ xLangfusePublicKey?: string | undefined;
6355
+ /** Additional query string parameters to include in the request. */
6356
+ queryParams?: Record<string, unknown>;
6357
+ /** Additional headers to include in the request. */
6358
+ headers?: Record<string, string | Supplier<string | null | undefined> | null | undefined>;
6359
+ }
6360
+ }
6361
+ declare class ObservationsV2 {
6362
+ protected readonly _options: ObservationsV2.Options;
6363
+ constructor(_options: ObservationsV2.Options);
6364
+ /**
6365
+ * Get a list of observations with cursor-based pagination and flexible field selection.
6366
+ *
6367
+ * ## Cursor-based Pagination
6368
+ * This endpoint uses cursor-based pagination for efficient traversal of large datasets.
6369
+ * The cursor is returned in the response metadata and should be passed in subsequent requests
6370
+ * to retrieve the next page of results.
6371
+ *
6372
+ * ## Field Selection
6373
+ * Use the `fields` parameter to control which observation fields are returned:
6374
+ * - `core` - Always included: id, traceId, startTime, endTime, projectId, parentObservationId, type
6375
+ * - `basic` - name, level, statusMessage, version, environment, bookmarked, public, userId, sessionId
6376
+ * - `time` - completionStartTime, createdAt, updatedAt
6377
+ * - `io` - input, output
6378
+ * - `metadata` - metadata (truncated to 200 chars by default, use `expandMetadata` to get full values)
6379
+ * - `model` - providedModelName, internalModelId, modelParameters
6380
+ * - `usage` - usageDetails, costDetails, totalCost
6381
+ * - `prompt` - promptId, promptName, promptVersion
6382
+ * - `metrics` - latency, timeToFirstToken
6383
+ *
6384
+ * If not specified, `core` and `basic` field groups are returned.
6385
+ *
6386
+ * ## Filters
6387
+ * Multiple filtering options are available via query parameters or the structured `filter` parameter.
6388
+ * When using the `filter` parameter, it takes precedence over individual query parameter filters.
6389
+ *
6390
+ * @param {LangfuseAPI.GetObservationsV2Request} request
6391
+ * @param {ObservationsV2.RequestOptions} requestOptions - Request-specific configuration.
6392
+ *
6393
+ * @throws {@link LangfuseAPI.Error}
6394
+ * @throws {@link LangfuseAPI.UnauthorizedError}
6395
+ * @throws {@link LangfuseAPI.AccessDeniedError}
6396
+ * @throws {@link LangfuseAPI.MethodNotAllowedError}
6397
+ * @throws {@link LangfuseAPI.NotFoundError}
6398
+ *
6399
+ * @example
6400
+ * await client.observationsV2.getMany()
6401
+ */
6402
+ getMany(request?: GetObservationsV2Request, requestOptions?: ObservationsV2.RequestOptions): HttpResponsePromise<ObservationsV2Response>;
6403
+ private __getMany;
6404
+ protected _getAuthorizationHeader(): Promise<string | undefined>;
6405
+ }
6406
+
5778
6407
  /**
5779
6408
  * This file was auto-generated by Fern from our API Definition.
5780
6409
  */
@@ -5835,7 +6464,9 @@ declare class Observations {
5835
6464
  get(observationId: string, requestOptions?: Observations.RequestOptions): HttpResponsePromise<ObservationsView>;
5836
6465
  private __get;
5837
6466
  /**
5838
- * Get a list of observations
6467
+ * Get a list of observations.
6468
+ *
6469
+ * Consider using the [v2 observations endpoint](/api-reference#tag/observationsv2/GET/api/public/v2/observations) for cursor-based pagination and field selection.
5839
6470
  *
5840
6471
  * @param {LangfuseAPI.GetObservationsRequest} request
5841
6472
  * @param {Observations.RequestOptions} requestOptions - Request-specific configuration.
@@ -6254,7 +6885,7 @@ declare class Projects {
6254
6885
  * await client.projects.update("projectId", {
6255
6886
  * name: "name",
6256
6887
  * metadata: undefined,
6257
- * retention: 1
6888
+ * retention: undefined
6258
6889
  * })
6259
6890
  */
6260
6891
  update(projectId: string, request: UpdateProjectRequest, requestOptions?: Projects.RequestOptions): HttpResponsePromise<Project>;
@@ -7249,8 +7880,10 @@ declare class LangfuseAPIClient {
7249
7880
  protected _ingestion: Ingestion | undefined;
7250
7881
  protected _llmConnections: LlmConnections | undefined;
7251
7882
  protected _media: Media | undefined;
7883
+ protected _metricsV2: MetricsV2 | undefined;
7252
7884
  protected _metrics: Metrics | undefined;
7253
7885
  protected _models: Models | undefined;
7886
+ protected _observationsV2: ObservationsV2 | undefined;
7254
7887
  protected _observations: Observations | undefined;
7255
7888
  protected _opentelemetry: Opentelemetry | undefined;
7256
7889
  protected _organizations: Organizations | undefined;
@@ -7274,8 +7907,10 @@ declare class LangfuseAPIClient {
7274
7907
  get ingestion(): Ingestion;
7275
7908
  get llmConnections(): LlmConnections;
7276
7909
  get media(): Media;
7910
+ get metricsV2(): MetricsV2;
7277
7911
  get metrics(): Metrics;
7278
7912
  get models(): Models;
7913
+ get observationsV2(): ObservationsV2;
7279
7914
  get observations(): Observations;
7280
7915
  get opentelemetry(): Opentelemetry;
7281
7916
  get organizations(): Organizations;
@@ -7657,4 +8292,4 @@ interface PropagateAttributesParams {
7657
8292
  declare function propagateAttributes<A extends unknown[], F extends (...args: A) => ReturnType<F>>(params: PropagateAttributesParams, fn: F): ReturnType<F>;
7658
8293
  declare function getPropagatedAttributesFromContext(context: Context): Record<string, string | string[]>;
7659
8294
 
7660
- export { AccessDeniedError, type AnnotationQueue, type AnnotationQueueAssignmentRequest, type AnnotationQueueItem, AnnotationQueueObjectType, AnnotationQueueStatus, type ApiKeyDeletionResponse, type ApiKeyList, type ApiKeyResponse, type ApiKeySummary, type AuthenticationScheme, type BaseEvent, type BasePrompt, type BaseScore, type BaseScoreV1, BlobStorageExportFrequency, BlobStorageExportMode, type BlobStorageIntegrationDeletionResponse, BlobStorageIntegrationFileType, type BlobStorageIntegrationResponse, BlobStorageIntegrationType, type BlobStorageIntegrationsResponse, type BooleanScore, type BooleanScoreV1, type BulkConfig, type CategoricalScore, type CategoricalScoreV1, type ChatMessage, ChatMessageWithPlaceholders, type ChatPrompt, type Comment, CommentObjectType, type ConfigCategory, type CreateAnnotationQueueAssignmentResponse, type CreateAnnotationQueueItemRequest, type CreateAnnotationQueueRequest, type CreateApiKeyRequest, type CreateBlobStorageIntegrationRequest, type CreateChatPromptRequest, type CreateCommentRequest, type CreateCommentResponse, type CreateDatasetItemRequest, type CreateDatasetRequest, type CreateDatasetRunItemRequest, type CreateEventBody, type CreateEventEvent, type CreateGenerationBody, type CreateGenerationEvent, type CreateModelRequest, type CreateObservationEvent, type CreateProjectRequest, CreatePromptRequest, type CreateScoreConfigRequest, type CreateScoreRequest, type CreateScoreResponse, type CreateScoreValue, type CreateSpanBody, type CreateSpanEvent, type CreateTextPromptRequest, type CreateUserRequest, type Dataset, type DatasetItem, type DatasetRun, type DatasetRunItem, type DatasetRunWithItems, DatasetStatus, type DeleteAnnotationQueueAssignmentResponse, type DeleteAnnotationQueueItemResponse, type DeleteDatasetItemResponse, type DeleteDatasetRunResponse, type DeleteMembershipRequest, type DeletePromptRequest, type DeleteTraceResponse, type DeleteTracesRequest, type EmptyResponse, Error$1 as Error, type FilterConfig, type GetAnnotationQueueItemsRequest, type GetAnnotationQueuesRequest, type GetCommentsRequest, type GetCommentsResponse, type GetDatasetItemsRequest, type GetDatasetRunsRequest, type GetDatasetsRequest, type GetLlmConnectionsRequest, type GetMediaResponse, type GetMediaUploadUrlRequest, type GetMediaUploadUrlResponse, type GetMetricsRequest, type GetModelsRequest, type GetObservationsRequest, type GetPromptRequest, type GetScoreConfigsRequest, type GetScoresRequest, type GetScoresResponse, GetScoresResponseData, type GetScoresResponseDataBoolean, type GetScoresResponseDataCategorical, type GetScoresResponseDataNumeric, type GetScoresResponseTraceData, type GetSessionsRequest, type GetTracesRequest, type HealthResponse, type IngestionError, IngestionEvent, type IngestionRequest, type IngestionResponse, type IngestionSuccess, type IngestionUsage, LANGFUSE_SDK_EXPERIMENT_ENVIRONMENT, LANGFUSE_SDK_NAME, LANGFUSE_SDK_VERSION, LANGFUSE_TRACER_NAME, LangfuseAPIClient, LangfuseAPIError, LangfuseAPITimeoutError, LangfuseMedia, type LangfuseMediaParams, LangfuseOtelContextKeys, LangfuseOtelSpanAttributes, type ListDatasetRunItemsRequest, type ListPromptsMetaRequest, type ListUsersRequest, LlmAdapter, type LlmConnection, LogLevel, Logger, type LoggerConfig, type MapValue, MediaContentType, type MembershipDeletionResponse, type MembershipRequest, type MembershipResponse, MembershipRole, type MembershipsResponse, MethodNotAllowedError, type MetricsResponse, type Model, type ModelPrice, ModelUsageUnit, NotFoundError, type NumericScore, type NumericScoreV1, type Observation, type ObservationBody, ObservationLevel, ObservationType, type Observations$1 as Observations, type ObservationsView, type ObservationsViews, type OpenAiCompletionUsageSchema, type OpenAiResponseUsageSchema, type OpenAiUsage, type OptionalObservationBody, type OrganizationApiKey, type OrganizationApiKeysResponse, type OrganizationProject, type OrganizationProjectsResponse, type OtelAttribute, type OtelAttributeValue, type OtelResource, type OtelResourceSpan, type OtelScope, type OtelScopeSpan, type OtelSpan, type OtelTraceRequest, type OtelTraceResponse, type PaginatedAnnotationQueueItems, type PaginatedAnnotationQueues, type PaginatedDatasetItems, type PaginatedDatasetRunItems, type PaginatedDatasetRuns, type PaginatedDatasets, type PaginatedLlmConnections, type PaginatedModels, type PaginatedSessions, type ParsedMediaReference, type PatchMediaBody, type PlaceholderMessage, type PricingTier, type PricingTierCondition, type PricingTierInput, PricingTierOperator, type Project, type ProjectDeletionResponse, type Projects$1 as Projects, Prompt, type PromptMeta, type PromptMetaListResponse, PromptType, type PropagateAttributesParams, type ResourceMeta, type ResourceType, type ResourceTypesResponse, type SchemaExtension, type SchemaResource, type SchemasResponse, type ScimEmail, type ScimFeatureSupport, type ScimName, type ScimUser, type ScimUsersListResponse, Score$1 as Score, type ScoreBody, type ScoreConfig, type ScoreConfigs$1 as ScoreConfigs, ScoreDataType, type ScoreEvent, ScoreSource, ScoreV1, type SdkLogBody, type SdkLogEvent, type ServiceProviderConfig, ServiceUnavailableError, type Session, type SessionWithTraces, type Sort, type TextPrompt, type Trace$1 as Trace, type TraceBody, type TraceEvent, type TraceWithDetails, type TraceWithFullDetails, type Traces, UnauthorizedError, type UpdateAnnotationQueueItemRequest, type UpdateEventBody, type UpdateGenerationBody, type UpdateGenerationEvent, type UpdateObservationEvent, type UpdateProjectRequest, type UpdatePromptRequest, type UpdateScoreConfigRequest, type UpdateSpanBody, type UpdateSpanEvent, type UpsertLlmConnectionRequest, type Usage, type UsageDetails, type UserMeta, index$q as annotationQueues, base64Decode, base64Encode, base64ToBytes, index$p as blobStorageIntegrations, bytesToBase64, index$o as comments, index$n as commons, configureGlobalLogger, createExperimentId, createExperimentItemId, createLogger, index$m as datasetItems, index$l as datasetRunItems, index$k as datasets, generateUUID, getEnv, getGlobalLogger, getPropagatedAttributesFromContext, index$j as health, index$i as ingestion, index$h as llmConnections, LoggerSingleton as logger, index$g as media, index$f as metrics, index$e as models, index$d as observations, index$c as opentelemetry, index$b as organizations, index$a as projects, index as promptVersion, index$9 as prompts, propagateAttributes, resetGlobalLogger, safeSetTimeout, index$8 as scim, index$5 as score, index$7 as scoreConfigs, index$6 as scoreV2, serializeValue, index$4 as sessions, index$3 as trace, index$1 as utils };
8295
+ export { AccessDeniedError, type AnnotationQueue, type AnnotationQueueAssignmentRequest, type AnnotationQueueItem, AnnotationQueueObjectType, AnnotationQueueStatus, type ApiKeyDeletionResponse, type ApiKeyList, type ApiKeyResponse, type ApiKeySummary, type AuthenticationScheme, type BaseEvent, type BasePrompt, type BaseScore, type BaseScoreV1, BlobStorageExportFrequency, BlobStorageExportMode, type BlobStorageIntegrationDeletionResponse, BlobStorageIntegrationFileType, type BlobStorageIntegrationResponse, BlobStorageIntegrationType, type BlobStorageIntegrationsResponse, type BooleanScore, type BooleanScoreV1, type BulkConfig, type CategoricalScore, type CategoricalScoreV1, type ChatMessage, ChatMessageWithPlaceholders, type ChatPrompt, type Comment, CommentObjectType, type ConfigCategory, type CorrectionScore, type CreateAnnotationQueueAssignmentResponse, type CreateAnnotationQueueItemRequest, type CreateAnnotationQueueRequest, type CreateApiKeyRequest, type CreateBlobStorageIntegrationRequest, type CreateChatPromptRequest, type CreateCommentRequest, type CreateCommentResponse, type CreateDatasetItemRequest, type CreateDatasetRequest, type CreateDatasetRunItemRequest, type CreateEventBody, type CreateEventEvent, type CreateGenerationBody, type CreateGenerationEvent, type CreateModelRequest, type CreateObservationEvent, type CreateProjectRequest, CreatePromptRequest, type CreateScoreConfigRequest, type CreateScoreRequest, type CreateScoreResponse, type CreateScoreValue, type CreateSpanBody, type CreateSpanEvent, type CreateTextPromptRequest, type CreateUserRequest, type Dataset, type DatasetItem, type DatasetRun, type DatasetRunItem, type DatasetRunWithItems, DatasetStatus, type DeleteAnnotationQueueAssignmentResponse, type DeleteAnnotationQueueItemResponse, type DeleteDatasetItemResponse, type DeleteDatasetRunResponse, type DeleteMembershipRequest, type DeletePromptRequest, type DeleteTraceResponse, type DeleteTracesRequest, type EmptyResponse, Error$1 as Error, type FilterConfig, type GetAnnotationQueueItemsRequest, type GetAnnotationQueuesRequest, type GetCommentsRequest, type GetCommentsResponse, type GetDatasetItemsRequest, type GetDatasetRunsRequest, type GetDatasetsRequest, type GetLlmConnectionsRequest, type GetMediaResponse, type GetMediaUploadUrlRequest, type GetMediaUploadUrlResponse, type GetMetricsRequest, type GetMetricsV2Request, type GetModelsRequest, type GetObservationsRequest, type GetObservationsV2Request, type GetPromptRequest, type GetScoreConfigsRequest, type GetScoresRequest, type GetScoresResponse, GetScoresResponseData, type GetScoresResponseDataBoolean, type GetScoresResponseDataCategorical, type GetScoresResponseDataCorrection, type GetScoresResponseDataNumeric, type GetScoresResponseTraceData, type GetSessionsRequest, type GetTracesRequest, type HealthResponse, type IngestionError, IngestionEvent, type IngestionRequest, type IngestionResponse, type IngestionSuccess, type IngestionUsage, LANGFUSE_SDK_EXPERIMENT_ENVIRONMENT, LANGFUSE_SDK_NAME, LANGFUSE_SDK_VERSION, LANGFUSE_TRACER_NAME, LangfuseAPIClient, LangfuseAPIError, LangfuseAPITimeoutError, LangfuseMedia, type LangfuseMediaParams, LangfuseOtelContextKeys, LangfuseOtelSpanAttributes, type ListDatasetRunItemsRequest, type ListPromptsMetaRequest, type ListUsersRequest, LlmAdapter, type LlmConnection, LogLevel, Logger, type LoggerConfig, type MapValue, MediaContentType, type MembershipDeletionResponse, type MembershipRequest, type MembershipResponse, MembershipRole, type MembershipsResponse, MethodNotAllowedError, type MetricsResponse, type MetricsV2Response, type Model, type ModelPrice, ModelUsageUnit, NotFoundError, type NumericScore, type NumericScoreV1, type Observation, type ObservationBody, ObservationLevel, ObservationType, type Observations$1 as Observations, type ObservationsV2Meta, type ObservationsV2Response, type ObservationsView, type ObservationsViews, type OpenAiCompletionUsageSchema, type OpenAiResponseUsageSchema, type OpenAiUsage, type OptionalObservationBody, type Organization, type OrganizationApiKey, type OrganizationApiKeysResponse, type OrganizationProject, type OrganizationProjectsResponse, type OtelAttribute, type OtelAttributeValue, type OtelResource, type OtelResourceSpan, type OtelScope, type OtelScopeSpan, type OtelSpan, type OtelTraceRequest, type OtelTraceResponse, type PaginatedAnnotationQueueItems, type PaginatedAnnotationQueues, type PaginatedDatasetItems, type PaginatedDatasetRunItems, type PaginatedDatasetRuns, type PaginatedDatasets, type PaginatedLlmConnections, type PaginatedModels, type PaginatedSessions, type ParsedMediaReference, type PatchMediaBody, type PlaceholderMessage, type PricingTier, type PricingTierCondition, type PricingTierInput, PricingTierOperator, type Project, type ProjectDeletionResponse, type Projects$1 as Projects, Prompt, type PromptMeta, type PromptMetaListResponse, PromptType, type PropagateAttributesParams, type ResourceMeta, type ResourceType, type ResourceTypesResponse, type SchemaExtension, type SchemaResource, type SchemasResponse, type ScimEmail, type ScimFeatureSupport, type ScimName, type ScimUser, type ScimUsersListResponse, Score$1 as Score, type ScoreBody, type ScoreConfig, ScoreConfigDataType, type ScoreConfigs$1 as ScoreConfigs, ScoreDataType, type ScoreEvent, ScoreSource, ScoreV1, type SdkLogBody, type SdkLogEvent, type ServiceProviderConfig, ServiceUnavailableError, type Session, type SessionWithTraces, type Sort, type TextPrompt, type Trace$1 as Trace, type TraceBody, type TraceEvent, type TraceWithDetails, type TraceWithFullDetails, type Traces, UnauthorizedError, type UpdateAnnotationQueueItemRequest, type UpdateEventBody, type UpdateGenerationBody, type UpdateGenerationEvent, type UpdateObservationEvent, type UpdateProjectRequest, type UpdatePromptRequest, type UpdateScoreConfigRequest, type UpdateSpanBody, type UpdateSpanEvent, type UpsertLlmConnectionRequest, type Usage, type UsageDetails, type UserMeta, index$s as annotationQueues, base64Decode, base64Encode, base64ToBytes, index$r as blobStorageIntegrations, bytesToBase64, index$q as comments, index$p as commons, configureGlobalLogger, createExperimentId, createExperimentItemId, createLogger, index$o as datasetItems, index$n as datasetRunItems, index$m as datasets, generateUUID, getEnv, getGlobalLogger, getPropagatedAttributesFromContext, index$l as health, index$k as ingestion, index$j as llmConnections, LoggerSingleton as logger, index$i as media, index$g as metrics, index$h as metricsV2, index$f as models, index$d as observations, index$e as observationsV2, index$c as opentelemetry, index$b as organizations, index$a as projects, index as promptVersion, index$9 as prompts, propagateAttributes, resetGlobalLogger, safeSetTimeout, index$8 as scim, index$5 as score, index$7 as scoreConfigs, index$6 as scoreV2, serializeValue, index$4 as sessions, index$3 as trace, index$1 as utils };