@langfuse/core 5.0.1 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -184,6 +184,7 @@ function serializeValue(value) {
184
184
 
185
185
  // src/logger/index.ts
186
186
  var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
187
+ LogLevel2[LogLevel2["NONE"] = 4] = "NONE";
187
188
  LogLevel2[LogLevel2["ERROR"] = 3] = "ERROR";
188
189
  LogLevel2[LogLevel2["WARN"] = 2] = "WARN";
189
190
  LogLevel2[LogLevel2["INFO"] = 1] = "INFO";
@@ -198,6 +199,8 @@ function parseLogLevelFromEnv() {
198
199
  const envValue = getEnv("LANGFUSE_LOG_LEVEL");
199
200
  const value = (envValue != null ? envValue : "").toUpperCase();
200
201
  switch (value) {
202
+ case "NONE":
203
+ return 4 /* NONE */;
201
204
  case "ERROR":
202
205
  return 3 /* ERROR */;
203
206
  case "WARN":
@@ -377,7 +380,7 @@ var resetGlobalLogger = () => {
377
380
  // package.json
378
381
  var package_default = {
379
382
  name: "@langfuse/core",
380
- version: "5.0.1",
383
+ version: "5.1.0",
381
384
  description: "Core functions and utilities for Langfuse packages",
382
385
  type: "module",
383
386
  sideEffects: false,
@@ -603,7 +606,8 @@ var ScoreSource = {
603
606
  var ScoreConfigDataType = {
604
607
  Numeric: "NUMERIC",
605
608
  Boolean: "BOOLEAN",
606
- Categorical: "CATEGORICAL"
609
+ Categorical: "CATEGORICAL",
610
+ Text: "TEXT"
607
611
  };
608
612
 
609
613
  // src/api/api/resources/commons/types/ScoreDataType.ts
@@ -611,7 +615,8 @@ var ScoreDataType = {
611
615
  Numeric: "NUMERIC",
612
616
  Boolean: "BOOLEAN",
613
617
  Categorical: "CATEGORICAL",
614
- Correction: "CORRECTION"
618
+ Correction: "CORRECTION",
619
+ Text: "TEXT"
615
620
  };
616
621
 
617
622
  // src/api/core/json.ts
@@ -2940,7 +2945,8 @@ var BlobStorageIntegrations = class {
2940
2945
  * forcePathStyle: true,
2941
2946
  * fileType: "JSON",
2942
2947
  * exportMode: "FULL_HISTORY",
2943
- * exportStartDate: undefined
2948
+ * exportStartDate: undefined,
2949
+ * compressed: undefined
2944
2950
  * })
2945
2951
  */
2946
2952
  upsertBlobStorageIntegration(request, requestOptions) {
@@ -4099,7 +4105,8 @@ var DatasetRunItems = class {
4099
4105
  * datasetItemId: "datasetItemId",
4100
4106
  * observationId: undefined,
4101
4107
  * traceId: undefined,
4102
- * datasetVersion: undefined
4108
+ * datasetVersion: undefined,
4109
+ * createdAt: undefined
4103
4110
  * })
4104
4111
  */
4105
4112
  create(request, requestOptions) {
@@ -11653,6 +11660,7 @@ var Trace = class {
11653
11660
  * Get a specific trace
11654
11661
  *
11655
11662
  * @param {string} traceId - The unique langfuse identifier of a trace
11663
+ * @param {LangfuseAPI.GetTraceRequest} request
11656
11664
  * @param {Trace.RequestOptions} requestOptions - Request-specific configuration.
11657
11665
  *
11658
11666
  * @throws {@link LangfuseAPI.Error}
@@ -11664,13 +11672,18 @@ var Trace = class {
11664
11672
  * @example
11665
11673
  * await client.trace.get("traceId")
11666
11674
  */
11667
- get(traceId, requestOptions) {
11675
+ get(traceId, request = {}, requestOptions) {
11668
11676
  return HttpResponsePromise.fromPromise(
11669
- this.__get(traceId, requestOptions)
11677
+ this.__get(traceId, request, requestOptions)
11670
11678
  );
11671
11679
  }
11672
- async __get(traceId, requestOptions) {
11680
+ async __get(traceId, request = {}, requestOptions) {
11673
11681
  var _a2, _b, _c, _d, _e, _f, _g, _h;
11682
+ const { fields } = request;
11683
+ const _queryParams = {};
11684
+ if (fields != null) {
11685
+ _queryParams["fields"] = fields;
11686
+ }
11674
11687
  let _headers = mergeHeaders(
11675
11688
  (_a2 = this._options) == null ? void 0 : _a2.headers,
11676
11689
  mergeOnlyDefinedHeaders({
@@ -11688,7 +11701,7 @@ var Trace = class {
11688
11701
  ),
11689
11702
  method: "GET",
11690
11703
  headers: _headers,
11691
- queryParameters: requestOptions == null ? void 0 : requestOptions.queryParams,
11704
+ queryParameters: { ..._queryParams, ...requestOptions == null ? void 0 : requestOptions.queryParams },
11692
11705
  timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4,
11693
11706
  maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries,
11694
11707
  abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal