From f1d55fe0b4d0cc3e455b326e9c69d6567e66b0f7 Mon Sep 17 00:00:00 2001 From: langfuse-bot Date: Wed, 10 Jun 2026 13:57:30 +0000 Subject: [PATCH] feat(api): update API spec from langfuse/langfuse 845137b --- langfuse/api/scores/client.py | 12 ++++++++++ langfuse/api/scores/raw_client.py | 12 ++++++++++ langfuse/api/scores_v3/client.py | 34 ++++++++++++++++++++-------- langfuse/api/scores_v3/raw_client.py | 34 ++++++++++++++++++++-------- 4 files changed, 72 insertions(+), 20 deletions(-) diff --git a/langfuse/api/scores/client.py b/langfuse/api/scores/client.py index 566530e21..3de8f5ef0 100644 --- a/langfuse/api/scores/client.py +++ b/langfuse/api/scores/client.py @@ -54,6 +54,9 @@ def get_many( request_options: typing.Optional[RequestOptions] = None, ) -> GetScoresResponse: """ + **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) Parameters @@ -172,6 +175,9 @@ def get_by_id( self, score_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> Score: """ + **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) Parameters @@ -250,6 +256,9 @@ async def get_many( request_options: typing.Optional[RequestOptions] = None, ) -> GetScoresResponse: """ + **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) Parameters @@ -376,6 +385,9 @@ async def get_by_id( self, score_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> Score: """ + **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) Parameters diff --git a/langfuse/api/scores/raw_client.py b/langfuse/api/scores/raw_client.py index d1508545c..3105cb18d 100644 --- a/langfuse/api/scores/raw_client.py +++ b/langfuse/api/scores/raw_client.py @@ -53,6 +53,9 @@ def get_many( request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[GetScoresResponse]: """ + **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) Parameters @@ -241,6 +244,9 @@ def get_by_id( self, score_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> HttpResponse[Score]: """ + **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) Parameters @@ -370,6 +376,9 @@ async def get_many( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[GetScoresResponse]: """ + **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) Parameters @@ -558,6 +567,9 @@ async def get_by_id( self, score_id: str, *, request_options: typing.Optional[RequestOptions] = None ) -> AsyncHttpResponse[Score]: """ + **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) Parameters diff --git a/langfuse/api/scores_v3/client.py b/langfuse/api/scores_v3/client.py index 2755d3e74..d5afda7dd 100644 --- a/langfuse/api/scores_v3/client.py +++ b/langfuse/api/scores_v3/client.py @@ -52,15 +52,22 @@ def get_many_v3( """ 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. Parameters ---------- @@ -71,7 +78,7 @@ def get_many_v3( URL-safe base64 (base64url) cursor for pagination. Use the cursor from the previous response to get the next page. Absent on the final page. fields : typing.Optional[str] - 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. id : typing.Optional[str] Comma-separated list of score IDs to filter by (OR within, AND across filters). @@ -214,15 +221,22 @@ async def get_many_v3( """ 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. Parameters ---------- @@ -233,7 +247,7 @@ async def get_many_v3( URL-safe base64 (base64url) cursor for pagination. Use the cursor from the previous response to get the next page. Absent on the final page. fields : typing.Optional[str] - 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. id : typing.Optional[str] Comma-separated list of score IDs to filter by (OR within, AND across filters). diff --git a/langfuse/api/scores_v3/raw_client.py b/langfuse/api/scores_v3/raw_client.py index 47c9f3f8d..cc0793172 100644 --- a/langfuse/api/scores_v3/raw_client.py +++ b/langfuse/api/scores_v3/raw_client.py @@ -50,15 +50,22 @@ def get_many_v3( """ 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. Parameters ---------- @@ -69,7 +76,7 @@ def get_many_v3( URL-safe base64 (base64url) cursor for pagination. Use the cursor from the previous response to get the next page. Absent on the final page. fields : typing.Optional[str] - 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. id : typing.Optional[str] Comma-separated list of score IDs to filter by (OR within, AND across filters). @@ -271,15 +278,22 @@ async def get_many_v3( """ 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. Parameters ---------- @@ -290,7 +304,7 @@ async def get_many_v3( URL-safe base64 (base64url) cursor for pagination. Use the cursor from the previous response to get the next page. Absent on the final page. fields : typing.Optional[str] - 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. id : typing.Optional[str] Comma-separated list of score IDs to filter by (OR within, AND across filters).