diff --git a/langfuse/api/observations/client.py b/langfuse/api/observations/client.py index 5e717adb6..69323ba72 100644 --- a/langfuse/api/observations/client.py +++ b/langfuse/api/observations/client.py @@ -56,7 +56,10 @@ def get_many( ## Cursor-based Pagination This endpoint uses cursor-based pagination for efficient traversal of large datasets. The cursor is returned in the response metadata and should be passed in subsequent requests - to retrieve the next page of results. + to retrieve the next page of results. The `limit` parameter is a maximum: a page may contain + fewer items than the requested limit, including zero items, while `meta.cursor` is present. + Continue requesting pages until `meta.cursor` is absent. + Requests without a lower start-time bound may search only from January 1, 2020. ## Field Selection Use the `fields` parameter to control which observation fields are returned: @@ -92,7 +95,7 @@ def get_many( Example: "key1,key2" limit : typing.Optional[int] - Number of items to return per page. Maximum 1000, default 50. + Maximum number of items to return per page. A page may contain fewer items, including zero items, while meta.cursor is present. Maximum 1000, default 50. cursor : typing.Optional[str] Base64-encoded cursor for pagination. Use the cursor from the previous response to get the next page. @@ -342,7 +345,10 @@ async def get_many( ## Cursor-based Pagination This endpoint uses cursor-based pagination for efficient traversal of large datasets. The cursor is returned in the response metadata and should be passed in subsequent requests - to retrieve the next page of results. + to retrieve the next page of results. The `limit` parameter is a maximum: a page may contain + fewer items than the requested limit, including zero items, while `meta.cursor` is present. + Continue requesting pages until `meta.cursor` is absent. + Requests without a lower start-time bound may search only from January 1, 2020. ## Field Selection Use the `fields` parameter to control which observation fields are returned: @@ -378,7 +384,7 @@ async def get_many( Example: "key1,key2" limit : typing.Optional[int] - Number of items to return per page. Maximum 1000, default 50. + Maximum number of items to return per page. A page may contain fewer items, including zero items, while meta.cursor is present. Maximum 1000, default 50. cursor : typing.Optional[str] Base64-encoded cursor for pagination. Use the cursor from the previous response to get the next page. diff --git a/langfuse/api/observations/raw_client.py b/langfuse/api/observations/raw_client.py index 84dba4891..d715fa0b6 100644 --- a/langfuse/api/observations/raw_client.py +++ b/langfuse/api/observations/raw_client.py @@ -54,7 +54,10 @@ def get_many( ## Cursor-based Pagination This endpoint uses cursor-based pagination for efficient traversal of large datasets. The cursor is returned in the response metadata and should be passed in subsequent requests - to retrieve the next page of results. + to retrieve the next page of results. The `limit` parameter is a maximum: a page may contain + fewer items than the requested limit, including zero items, while `meta.cursor` is present. + Continue requesting pages until `meta.cursor` is absent. + Requests without a lower start-time bound may search only from January 1, 2020. ## Field Selection Use the `fields` parameter to control which observation fields are returned: @@ -90,7 +93,7 @@ def get_many( Example: "key1,key2" limit : typing.Optional[int] - Number of items to return per page. Maximum 1000, default 50. + Maximum number of items to return per page. A page may contain fewer items, including zero items, while meta.cursor is present. Maximum 1000, default 50. cursor : typing.Optional[str] Base64-encoded cursor for pagination. Use the cursor from the previous response to get the next page. @@ -399,7 +402,10 @@ async def get_many( ## Cursor-based Pagination This endpoint uses cursor-based pagination for efficient traversal of large datasets. The cursor is returned in the response metadata and should be passed in subsequent requests - to retrieve the next page of results. + to retrieve the next page of results. The `limit` parameter is a maximum: a page may contain + fewer items than the requested limit, including zero items, while `meta.cursor` is present. + Continue requesting pages until `meta.cursor` is absent. + Requests without a lower start-time bound may search only from January 1, 2020. ## Field Selection Use the `fields` parameter to control which observation fields are returned: @@ -435,7 +441,7 @@ async def get_many( Example: "key1,key2" limit : typing.Optional[int] - Number of items to return per page. Maximum 1000, default 50. + Maximum number of items to return per page. A page may contain fewer items, including zero items, while meta.cursor is present. Maximum 1000, default 50. cursor : typing.Optional[str] Base64-encoded cursor for pagination. Use the cursor from the previous response to get the next page. diff --git a/langfuse/api/observations/types/observations_v2meta.py b/langfuse/api/observations/types/observations_v2meta.py index 46d9f42aa..2b34f8664 100644 --- a/langfuse/api/observations/types/observations_v2meta.py +++ b/langfuse/api/observations/types/observations_v2meta.py @@ -11,6 +11,11 @@ class ObservationsV2Meta(CursorMetaResponse): Metadata for cursor-based pagination. """ + comment: typing.Optional[str] = pydantic.Field(default=None) + """ + Present when an empty page has a cursor; continue requesting pages until the cursor is absent. + """ + model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict( extra="allow", frozen=True ) diff --git a/langfuse/api/observations/types/observations_v2response.py b/langfuse/api/observations/types/observations_v2response.py index 0ee1fb8bd..d702b59f7 100644 --- a/langfuse/api/observations/types/observations_v2response.py +++ b/langfuse/api/observations/types/observations_v2response.py @@ -13,7 +13,9 @@ class ObservationsV2Response(UniversalBaseModel): Response containing observations with field-group-based filtering and cursor-based pagination. The `data` array contains observation objects with only the requested field groups included. - Use the `cursor` in `meta` to retrieve the next page of results. + Use the `cursor` in `meta` to retrieve the next page of results. The array may contain fewer + than the requested `limit` items, or be empty, while a cursor is present. Continue until the + cursor is absent. """ data: typing.List[ObservationV2] = pydantic.Field()