Skip to content

Commit 72d6c72

Browse files
langfuse-botlangfuse-botmarliessophie
authored
feat(api): update API spec from langfuse/langfuse b8db8b6 (#831)
Co-authored-by: langfuse-bot <langfuse-bot@langfuse.com> Co-authored-by: marliessophie <74332854+marliessophie@users.noreply.github.com>
1 parent d4d7c37 commit 72d6c72

8 files changed

Lines changed: 28 additions & 17 deletions

File tree

packages/core/src/api/api/resources/blobStorageIntegrations/types/BlobStorageExportFieldGroup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44

55
/**
6-
* Field group for the OBSERVATIONS_V2 and LEGACY_TRACES_AND_ENRICHED_OBSERVATIONS export.
6+
* 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.
77
*/
88
export type BlobStorageExportFieldGroup =
99
| "core"

packages/core/src/api/api/resources/blobStorageIntegrations/types/BlobStorageExportSource.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
/**
66
* What data the integration exports.
7-
* - `LEGACY_TRACES_OBSERVATIONS`: traces, observations, and scores tables with a fixed column set. The `exportFieldGroups` field is not applicable.
7+
* - `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.
88
* - `OBSERVATIONS_V2`: same data model as the `/api/public/v2/observations` endpoint, plus scores. Columns are controlled by `exportFieldGroups`.
9-
* - `LEGACY_TRACES_AND_ENRICHED_OBSERVATIONS`: both sets. For the `OBSERVATIONS_V2` portion, columns are controlled by `exportFieldGroups`.
9+
* - `LEGACY_TRACES_AND_ENRICHED_OBSERVATIONS`: both sets. Observation columns of both portions are controlled by `exportFieldGroups`.
1010
*
1111
* **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.
1212
*/

packages/core/src/api/api/resources/blobStorageIntegrations/types/BlobStorageIntegrationResponse.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export interface BlobStorageIntegrationResponse {
2121
exportStartDate: string | null;
2222
compressed: boolean;
2323
exportSource: LangfuseAPI.BlobStorageExportSource;
24-
/** 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). */
24+
/** Field groups included in each exported observation row. An empty list is treated as all groups during export. */
2525
exportFieldGroups: LangfuseAPI.BlobStorageExportFieldGroup[] | null;
2626
nextSyncAt: string | null;
2727
lastSyncAt: string | null;

packages/core/src/api/api/resources/blobStorageIntegrations/types/CreateBlobStorageIntegrationRequest.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,15 @@ export interface CreateBlobStorageIntegrationRequest {
3232
/** Enable gzip compression for exported files (.csv.gz, .json.gz, .jsonl.gz). Defaults to true. */
3333
compressed?: boolean;
3434
/**
35-
* Data to export. When omitted on update, the existing value is preserved. When omitted on create: pre-cutoff Cloud projects and self-hosted deployments fall back to `LEGACY_TRACES_OBSERVATIONS`; post-cutoff Cloud projects (created on or after 2026-05-20) auto-default to `OBSERVATIONS_V2`. Required when `exportFieldGroups` is provided.
35+
* Data to export. When omitted on update, the existing value is preserved. When omitted on create: integrations on Langfuse Cloud default to `OBSERVATIONS_V2`; self-hosted deployments fall back to `LEGACY_TRACES_OBSERVATIONS`. Required when `exportFieldGroups` is provided.
3636
*
37-
* **Cloud-only deprecation gate (effective 2026-05-20):** For projects created on or after 2026-05-20 on Langfuse Cloud, `LEGACY_TRACES_OBSERVATIONS` and `LEGACY_TRACES_AND_ENRICHED_OBSERVATIONS` are rejected with HTTP 400. Omitting `exportSource` on these projects silently defaults to `OBSERVATIONS_V2` rather than the schema column default. Use `OBSERVATIONS_V2` for all new integrations. Projects created before 2026-05-20 and self-hosted deployments are unaffected.
37+
* **Cloud-only project deprecation gate (effective 2026-05-20):** For projects created on or after 2026-05-20 on Langfuse Cloud, `LEGACY_TRACES_OBSERVATIONS` and `LEGACY_TRACES_AND_ENRICHED_OBSERVATIONS` are rejected with HTTP 400. Use `OBSERVATIONS_V2` for all new integrations. Self-hosted deployments are unaffected.
38+
*
39+
* **Cloud-only integration deprecation gate (effective 2026-06-22):** On Langfuse Cloud, legacy export sources are only accepted for blob storage integrations created before 2026-06-22, regardless of project age. Requests that would create a new integration with `LEGACY_TRACES_OBSERVATIONS` or `LEGACY_TRACES_AND_ENRICHED_OBSERVATIONS` are rejected with HTTP 400. Use `OBSERVATIONS_V2` instead. Self-hosted deployments are unaffected.
3840
*/
3941
exportSource?: LangfuseAPI.BlobStorageExportSource;
4042
/**
41-
* Field groups to include in each exported row.
42-
*
43-
* 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.
44-
*
45-
* 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.
43+
* 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.
4644
*
4745
* `exportFieldGroups` requires `exportSource` to be provided in the same request.
4846
*/

packages/core/src/api/api/resources/datasetItems/types/CreateDatasetItemRequest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export interface CreateDatasetItemRequest {
1111
metadata?: unknown;
1212
sourceTraceId?: string;
1313
sourceObservationId?: string;
14-
/** Dataset items are upserted on their id. Id needs to be unique (project-level) and cannot be reused across datasets. */
14+
/** 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. */
1515
id?: string;
1616
/** Defaults to ACTIVE for newly created items */
1717
status?: LangfuseAPI.DatasetStatus;

packages/core/src/api/api/resources/scores/client/Client.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ export class Scores {
6161
}
6262

6363
/**
64+
* **Deprecated.** Use `GET /api/public/v3/scores` instead. This endpoint
65+
* is no longer available on Langfuse v4 and later.
66+
*
6467
* Get a list of scores (supports both trace and session scores)
6568
*
6669
* @param {LangfuseAPI.GetScoresRequest} request
@@ -301,6 +304,9 @@ export class Scores {
301304
}
302305

303306
/**
307+
* **Deprecated.** Use `GET /api/public/v3/scores` with the `id` filter
308+
* instead. This endpoint is no longer available on Langfuse v4 and later.
309+
*
304310
* Get a score (supports both trace and session scores)
305311
*
306312
* @param {string} scoreId - The unique langfuse identifier of a score

packages/core/src/api/api/resources/scoresV3/client/Client.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,22 @@ export class ScoresV3 {
6363
/**
6464
* Get a list of scores with a polymorphic `value` field (v3).
6565
*
66-
* This endpoint requires Langfuse v4 or later.
67-
*
6866
* The `value` field type depends on `dataType`:
6967
* - `NUMERIC` → number
7068
* - `BOOLEAN` → boolean
7169
* - `CATEGORICAL`, `TEXT`, `CORRECTION` → string
7270
*
73-
* Use the `fields` parameter to include optional field groups beyond the
74-
* default `core`. Unknown group names return HTTP 400.
71+
* The response always includes the core fields: id, projectId, name,
72+
* value, dataType, source, timestamp, environment, createdAt, updatedAt.
73+
*
74+
* Additional field groups can be requested via the `fields` parameter:
75+
* - `details` — adds comment, configId, metadata
76+
* - `subject` — adds the subject object describing the entity the score
77+
* is attached to: kind (trace, observation, session, or experiment),
78+
* id, and traceId for observation-level scores
79+
* - `annotation` — adds authorUserId, queueId
80+
*
81+
* Unknown group names return HTTP 400.
7582
*
7683
* @param {LangfuseAPI.GetScoresV3Request} request
7784
* @param {ScoresV3.RequestOptions} requestOptions - Request-specific configuration.

packages/core/src/api/api/resources/scoresV3/client/requests/GetScoresV3Request.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export interface GetScoresV3Request {
1111
limit?: number;
1212
/** URL-safe base64 (base64url) cursor for pagination. Use the cursor from the previous response to get the next page. Absent on the final page. */
1313
cursor?: string;
14-
/** Comma-separated field groups to include. Allowed: core, details, subject, annotation. Defaults to "core". Unknown names return HTTP 400. */
14+
/** 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. */
1515
fields?: string;
1616
/** Comma-separated list of score IDs to filter by (OR within, AND across filters). */
1717
id?: string;

0 commit comments

Comments
 (0)