From 6cc1e6394ee54462b46c6e964f743aa1b5011199 Mon Sep 17 00:00:00 2001 From: langfuse-bot Date: Fri, 12 Jun 2026 12:20:50 +0000 Subject: [PATCH] feat(api): update API spec from langfuse/langfuse cf53f2e --- .../types/BlobStorageExportFieldGroup.ts | 2 +- .../types/BlobStorageExportSource.ts | 4 ++-- .../types/BlobStorageIntegrationResponse.ts | 2 +- .../types/CreateBlobStorageIntegrationRequest.ts | 6 +----- .../types/CreateDatasetItemRequest.ts | 2 +- .../src/api/api/resources/scores/client/Client.ts | 6 ++++++ .../api/api/resources/scoresV3/client/Client.ts | 15 +++++++++++---- .../client/requests/GetScoresV3Request.ts | 2 +- 8 files changed, 24 insertions(+), 15 deletions(-) diff --git a/packages/core/src/api/api/resources/blobStorageIntegrations/types/BlobStorageExportFieldGroup.ts b/packages/core/src/api/api/resources/blobStorageIntegrations/types/BlobStorageExportFieldGroup.ts index 5bfad40cb..465d8c38b 100644 --- a/packages/core/src/api/api/resources/blobStorageIntegrations/types/BlobStorageExportFieldGroup.ts +++ b/packages/core/src/api/api/resources/blobStorageIntegrations/types/BlobStorageExportFieldGroup.ts @@ -3,7 +3,7 @@ */ /** - * Field group for the OBSERVATIONS_V2 and LEGACY_TRACES_AND_ENRICHED_OBSERVATIONS export. + * Field group selecting which observation columns are included in the export. Applies to all export sources; groups without a counterpart in the legacy data model (e.g. `trace_context`) are omitted from the legacy observations export. */ export type BlobStorageExportFieldGroup = | "core" diff --git a/packages/core/src/api/api/resources/blobStorageIntegrations/types/BlobStorageExportSource.ts b/packages/core/src/api/api/resources/blobStorageIntegrations/types/BlobStorageExportSource.ts index 4ed7e2f2d..d7ea742a8 100644 --- a/packages/core/src/api/api/resources/blobStorageIntegrations/types/BlobStorageExportSource.ts +++ b/packages/core/src/api/api/resources/blobStorageIntegrations/types/BlobStorageExportSource.ts @@ -4,9 +4,9 @@ /** * What data the integration exports. - * - `LEGACY_TRACES_OBSERVATIONS`: traces, observations, and scores tables with a fixed column set. The `exportFieldGroups` field is not applicable. + * - `LEGACY_TRACES_OBSERVATIONS`: traces, observations, and scores tables. Observation columns are controlled by `exportFieldGroups`; field groups without a counterpart in this data model (e.g. `trace_context`) are omitted. * - `OBSERVATIONS_V2`: same data model as the `/api/public/v2/observations` endpoint, plus scores. Columns are controlled by `exportFieldGroups`. - * - `LEGACY_TRACES_AND_ENRICHED_OBSERVATIONS`: both sets. For the `OBSERVATIONS_V2` portion, columns are controlled by `exportFieldGroups`. + * - `LEGACY_TRACES_AND_ENRICHED_OBSERVATIONS`: both sets. Observation columns of both portions are controlled by `exportFieldGroups`. * * **Note:** `OBSERVATIONS_V2` and the enriched-observations portion of `LEGACY_TRACES_AND_ENRICHED_OBSERVATIONS` rely on the enriched observations table (Langfuse Fast Preview / v4), which is currently available on Langfuse Cloud only. See https://langfuse.com/docs/v4. */ diff --git a/packages/core/src/api/api/resources/blobStorageIntegrations/types/BlobStorageIntegrationResponse.ts b/packages/core/src/api/api/resources/blobStorageIntegrations/types/BlobStorageIntegrationResponse.ts index 082247878..c0c4539ff 100644 --- a/packages/core/src/api/api/resources/blobStorageIntegrations/types/BlobStorageIntegrationResponse.ts +++ b/packages/core/src/api/api/resources/blobStorageIntegrations/types/BlobStorageIntegrationResponse.ts @@ -21,7 +21,7 @@ export interface BlobStorageIntegrationResponse { exportStartDate: string | null; compressed: boolean; exportSource: LangfuseAPI.BlobStorageExportSource; - /** Field groups included in each exported row for `OBSERVATIONS_V2` / `LEGACY_TRACES_AND_ENRICHED_OBSERVATIONS` sources. Always `null` when exportSource is `LEGACY_TRACES_OBSERVATIONS` (the field does not apply to that source; any legacy DB value is hidden from the public surface). */ + /** Field groups included in each exported observation row. An empty list is treated as all groups during export. */ exportFieldGroups: LangfuseAPI.BlobStorageExportFieldGroup[] | null; nextSyncAt: string | null; lastSyncAt: string | null; diff --git a/packages/core/src/api/api/resources/blobStorageIntegrations/types/CreateBlobStorageIntegrationRequest.ts b/packages/core/src/api/api/resources/blobStorageIntegrations/types/CreateBlobStorageIntegrationRequest.ts index 7a490ecf7..a19b14d93 100644 --- a/packages/core/src/api/api/resources/blobStorageIntegrations/types/CreateBlobStorageIntegrationRequest.ts +++ b/packages/core/src/api/api/resources/blobStorageIntegrations/types/CreateBlobStorageIntegrationRequest.ts @@ -38,11 +38,7 @@ export interface CreateBlobStorageIntegrationRequest { */ exportSource?: LangfuseAPI.BlobStorageExportSource; /** - * Field groups to include in each exported row. - * - * For exportSource `OBSERVATIONS_V2` or `LEGACY_TRACES_AND_ENRICHED_OBSERVATIONS`: must include `core` if provided. When omitted on create, the column default (all groups) applies. When omitted on update, the existing value is preserved. - * - * For exportSource `LEGACY_TRACES_OBSERVATIONS`: this field must be omitted or null. Sending an array (including an empty array) returns 400, because that source uses a fixed column set and does not honor field groups. + * Field groups to include in each exported observation row. Applies to all export sources; must include `core` if provided. When omitted on create, the column default (all groups) applies. When omitted on update, the existing value is preserved. * * `exportFieldGroups` requires `exportSource` to be provided in the same request. */ diff --git a/packages/core/src/api/api/resources/datasetItems/types/CreateDatasetItemRequest.ts b/packages/core/src/api/api/resources/datasetItems/types/CreateDatasetItemRequest.ts index b8b0cf91b..40d0292b8 100644 --- a/packages/core/src/api/api/resources/datasetItems/types/CreateDatasetItemRequest.ts +++ b/packages/core/src/api/api/resources/datasetItems/types/CreateDatasetItemRequest.ts @@ -11,7 +11,7 @@ export interface CreateDatasetItemRequest { metadata?: unknown; sourceTraceId?: string; sourceObservationId?: string; - /** Dataset items are upserted on their id. Id needs to be unique (project-level) and cannot be reused across datasets. */ + /** Dataset items are upserted on their id. Id needs to be unique (project-level), cannot be reused across datasets, and must be at most 255 characters. */ id?: string; /** Defaults to ACTIVE for newly created items */ status?: LangfuseAPI.DatasetStatus; diff --git a/packages/core/src/api/api/resources/scores/client/Client.ts b/packages/core/src/api/api/resources/scores/client/Client.ts index 1bedc0bd5..c90244748 100644 --- a/packages/core/src/api/api/resources/scores/client/Client.ts +++ b/packages/core/src/api/api/resources/scores/client/Client.ts @@ -61,6 +61,9 @@ export class Scores { } /** + * **Deprecated.** Use `GET /api/public/v3/scores` instead. This endpoint + * is no longer available on Langfuse v4 and later. + * * Get a list of scores (supports both trace and session scores) * * @param {LangfuseAPI.GetScoresRequest} request @@ -301,6 +304,9 @@ export class Scores { } /** + * **Deprecated.** Use `GET /api/public/v3/scores` with the `id` filter + * instead. This endpoint is no longer available on Langfuse v4 and later. + * * Get a score (supports both trace and session scores) * * @param {string} scoreId - The unique langfuse identifier of a score diff --git a/packages/core/src/api/api/resources/scoresV3/client/Client.ts b/packages/core/src/api/api/resources/scoresV3/client/Client.ts index 96abff1a6..d620aeccd 100644 --- a/packages/core/src/api/api/resources/scoresV3/client/Client.ts +++ b/packages/core/src/api/api/resources/scoresV3/client/Client.ts @@ -63,15 +63,22 @@ export class ScoresV3 { /** * Get a list of scores with a polymorphic `value` field (v3). * - * This endpoint requires Langfuse v4 or later. - * * The `value` field type depends on `dataType`: * - `NUMERIC` → number * - `BOOLEAN` → boolean * - `CATEGORICAL`, `TEXT`, `CORRECTION` → string * - * Use the `fields` parameter to include optional field groups beyond the - * default `core`. Unknown group names return HTTP 400. + * The response always includes the core fields: id, projectId, name, + * value, dataType, source, timestamp, environment, createdAt, updatedAt. + * + * Additional field groups can be requested via the `fields` parameter: + * - `details` — adds comment, configId, metadata + * - `subject` — adds the subject object describing the entity the score + * is attached to: kind (trace, observation, session, or experiment), + * id, and traceId for observation-level scores + * - `annotation` — adds authorUserId, queueId + * + * Unknown group names return HTTP 400. * * @param {LangfuseAPI.GetScoresV3Request} request * @param {ScoresV3.RequestOptions} requestOptions - Request-specific configuration. diff --git a/packages/core/src/api/api/resources/scoresV3/client/requests/GetScoresV3Request.ts b/packages/core/src/api/api/resources/scoresV3/client/requests/GetScoresV3Request.ts index 398379036..ecc9c7b1e 100644 --- a/packages/core/src/api/api/resources/scoresV3/client/requests/GetScoresV3Request.ts +++ b/packages/core/src/api/api/resources/scoresV3/client/requests/GetScoresV3Request.ts @@ -11,7 +11,7 @@ export interface GetScoresV3Request { limit?: number; /** URL-safe base64 (base64url) cursor for pagination. Use the cursor from the previous response to get the next page. Absent on the final page. */ cursor?: string; - /** Comma-separated field groups to include. Allowed: core, details, subject, annotation. Defaults to "core". Unknown names return HTTP 400. */ + /** Comma-separated field groups to include in addition to the always-returned core fields. Allowed: details, subject, annotation — see the endpoint description for the fields each group adds. Unknown names return HTTP 400. */ fields?: string; /** Comma-separated list of score IDs to filter by (OR within, AND across filters). */ id?: string;