diff --git a/packages/core/src/api/api/resources/commons/types/ScoreConfig.ts b/packages/core/src/api/api/resources/commons/types/ScoreConfig.ts index 085bed4f..bfd8cff6 100644 --- a/packages/core/src/api/api/resources/commons/types/ScoreConfig.ts +++ b/packages/core/src/api/api/resources/commons/types/ScoreConfig.ts @@ -13,7 +13,7 @@ export interface ScoreConfig { createdAt: string; updatedAt: string; projectId: string; - dataType: LangfuseAPI.ScoreDataType; + dataType: LangfuseAPI.ScoreConfigDataType; /** Whether the score config is archived. Defaults to false */ isArchived: boolean; /** Sets minimum value for numerical scores. If not set, the minimum value defaults to -∞ */ diff --git a/packages/core/src/api/api/resources/commons/types/ScoreConfigDataType.ts b/packages/core/src/api/api/resources/commons/types/ScoreConfigDataType.ts new file mode 100644 index 00000000..16ceeaca --- /dev/null +++ b/packages/core/src/api/api/resources/commons/types/ScoreConfigDataType.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type ScoreConfigDataType = "NUMERIC" | "BOOLEAN" | "CATEGORICAL"; +export const ScoreConfigDataType = { + Numeric: "NUMERIC", + Boolean: "BOOLEAN", + Categorical: "CATEGORICAL", +} as const; diff --git a/packages/core/src/api/api/resources/commons/types/ScoreDataType.ts b/packages/core/src/api/api/resources/commons/types/ScoreDataType.ts index 971784fe..5a8699f5 100644 --- a/packages/core/src/api/api/resources/commons/types/ScoreDataType.ts +++ b/packages/core/src/api/api/resources/commons/types/ScoreDataType.ts @@ -2,9 +2,14 @@ * This file was auto-generated by Fern from our API Definition. */ -export type ScoreDataType = "NUMERIC" | "BOOLEAN" | "CATEGORICAL"; +export type ScoreDataType = + | "NUMERIC" + | "BOOLEAN" + | "CATEGORICAL" + | "CORRECTION"; export const ScoreDataType = { Numeric: "NUMERIC", Boolean: "BOOLEAN", Categorical: "CATEGORICAL", + Correction: "CORRECTION", } as const; diff --git a/packages/core/src/api/api/resources/commons/types/index.ts b/packages/core/src/api/api/resources/commons/types/index.ts index d48f1754..8bf3f801 100644 --- a/packages/core/src/api/api/resources/commons/types/index.ts +++ b/packages/core/src/api/api/resources/commons/types/index.ts @@ -37,4 +37,5 @@ export * from "./MapValue.js"; export * from "./CommentObjectType.js"; export * from "./DatasetStatus.js"; export * from "./ScoreSource.js"; +export * from "./ScoreConfigDataType.js"; export * from "./ScoreDataType.js"; diff --git a/packages/core/src/api/api/resources/ingestion/types/ScoreBody.ts b/packages/core/src/api/api/resources/ingestion/types/ScoreBody.ts index d16007b3..f7b890bb 100644 --- a/packages/core/src/api/api/resources/ingestion/types/ScoreBody.ts +++ b/packages/core/src/api/api/resources/ingestion/types/ScoreBody.ts @@ -82,6 +82,7 @@ export interface ScoreBody { sessionId?: string; observationId?: string; datasetRunId?: string; + /** The name of the score. Always overrides "output" for correction scores. */ name: string; environment?: string; /** The annotation queue referenced by the score. Indicates if score was initially created while processing annotation queue. */ diff --git a/packages/core/src/api/api/resources/metrics/client/Client.ts b/packages/core/src/api/api/resources/metrics/client/Client.ts index ee074ed4..5170c920 100644 --- a/packages/core/src/api/api/resources/metrics/client/Client.ts +++ b/packages/core/src/api/api/resources/metrics/client/Client.ts @@ -63,6 +63,8 @@ export class Metrics { /** * Get metrics from the Langfuse project using a query object. * + * Consider using the [v2 metrics endpoint](/api-reference#tag/metricsv2/GET/api/public/v2/metrics) for better performance. + * * For more details, see the [Metrics API documentation](https://langfuse.com/docs/metrics/features/metrics-api). * * @param {LangfuseAPI.GetMetricsRequest} request diff --git a/packages/core/src/api/api/resources/observations/client/Client.ts b/packages/core/src/api/api/resources/observations/client/Client.ts index 00b894d0..9508f708 100644 --- a/packages/core/src/api/api/resources/observations/client/Client.ts +++ b/packages/core/src/api/api/resources/observations/client/Client.ts @@ -182,7 +182,9 @@ export class Observations { } /** - * Get a list of observations + * Get a list of observations. + * + * Consider using the [v2 observations endpoint](/api-reference#tag/observationsv2/GET/api/public/v2/observations) for cursor-based pagination and field selection. * * @param {LangfuseAPI.GetObservationsRequest} request * @param {Observations.RequestOptions} requestOptions - Request-specific configuration. diff --git a/packages/core/src/api/api/resources/projects/types/Organization.ts b/packages/core/src/api/api/resources/projects/types/Organization.ts new file mode 100644 index 00000000..3968357e --- /dev/null +++ b/packages/core/src/api/api/resources/projects/types/Organization.ts @@ -0,0 +1,10 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface Organization { + /** The unique identifier of the organization */ + id: string; + /** The name of the organization */ + name: string; +} diff --git a/packages/core/src/api/api/resources/projects/types/Project.ts b/packages/core/src/api/api/resources/projects/types/Project.ts index 8a66c122..7d784467 100644 --- a/packages/core/src/api/api/resources/projects/types/Project.ts +++ b/packages/core/src/api/api/resources/projects/types/Project.ts @@ -2,9 +2,13 @@ * This file was auto-generated by Fern from our API Definition. */ +import * as LangfuseAPI from "../../../index.js"; + export interface Project { id: string; name: string; + /** The organization this project belongs to */ + organization: LangfuseAPI.Organization; /** Metadata for the project */ metadata: Record; /** Number of days to retain data. Null or 0 means no retention. Omitted if no retention is configured. */ diff --git a/packages/core/src/api/api/resources/projects/types/index.ts b/packages/core/src/api/api/resources/projects/types/index.ts index 99b68ac6..abae05b5 100644 --- a/packages/core/src/api/api/resources/projects/types/index.ts +++ b/packages/core/src/api/api/resources/projects/types/index.ts @@ -1,4 +1,5 @@ export * from "./Projects.js"; +export * from "./Organization.js"; export * from "./Project.js"; export * from "./ProjectDeletionResponse.js"; export * from "./ApiKeyList.js"; diff --git a/packages/core/src/api/api/resources/scoreConfigs/types/CreateScoreConfigRequest.ts b/packages/core/src/api/api/resources/scoreConfigs/types/CreateScoreConfigRequest.ts index e9c084e0..e5fb1055 100644 --- a/packages/core/src/api/api/resources/scoreConfigs/types/CreateScoreConfigRequest.ts +++ b/packages/core/src/api/api/resources/scoreConfigs/types/CreateScoreConfigRequest.ts @@ -6,7 +6,7 @@ import * as LangfuseAPI from "../../../index.js"; export interface CreateScoreConfigRequest { name: string; - dataType: LangfuseAPI.ScoreDataType; + dataType: LangfuseAPI.ScoreConfigDataType; /** 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 */ categories?: LangfuseAPI.ConfigCategory[]; /** Configure a minimum value for numerical scores. If not set, the minimum value defaults to -∞ */ diff --git a/packages/core/src/api/api/resources/scoreV2/client/Client.ts b/packages/core/src/api/api/resources/scoreV2/client/Client.ts index 355ebb13..f584d8ef 100644 --- a/packages/core/src/api/api/resources/scoreV2/client/Client.ts +++ b/packages/core/src/api/api/resources/scoreV2/client/Client.ts @@ -107,6 +107,7 @@ export class ScoreV2 { queueId, dataType, traceTags, + fields, } = request; const _queryParams: Record< string, @@ -192,6 +193,10 @@ export class ScoreV2 { } } + if (fields != null) { + _queryParams["fields"] = fields; + } + let _headers: core.Fetcher.Args["headers"] = mergeHeaders( this._options?.headers, mergeOnlyDefinedHeaders({ diff --git a/packages/core/src/api/api/resources/scoreV2/client/requests/GetScoresRequest.ts b/packages/core/src/api/api/resources/scoreV2/client/requests/GetScoresRequest.ts index be84937a..d294adff 100644 --- a/packages/core/src/api/api/resources/scoreV2/client/requests/GetScoresRequest.ts +++ b/packages/core/src/api/api/resources/scoreV2/client/requests/GetScoresRequest.ts @@ -45,4 +45,6 @@ export interface GetScoresRequest { dataType?: LangfuseAPI.ScoreDataType; /** Only scores linked to traces that include all of these tags will be returned. */ traceTags?: string | string[]; + /** 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. */ + fields?: string; }