diff --git a/langfuse/api/sessions/client.py b/langfuse/api/sessions/client.py index b99829feb..21c2e5b4f 100644 --- a/langfuse/api/sessions/client.py +++ b/langfuse/api/sessions/client.py @@ -36,7 +36,12 @@ def list( request_options: typing.Optional[RequestOptions] = None, ) -> PaginatedSessions: """ - Get sessions + Get sessions. + + This legacy endpoint is not recommended for new data extraction workflows. + Use the v2 observations endpoint with a bounded time range and group rows by + `sessionId` instead: + `GET /api/public/v2/observations?fromStartTime=&toStartTime=`. Parameters ---------- @@ -93,7 +98,12 @@ def get( request_options: typing.Optional[RequestOptions] = None, ) -> SessionWithTraces: """ - Get a session. Please note that `traces` on this endpoint are not paginated, if you plan to fetch large sessions, consider `GET /api/public/traces?sessionId=` + Get a session. + + Please note that `traces` on this endpoint are not paginated. For large + sessions or new data extraction workflows, use the v2 observations endpoint + with a URL-encoded `sessionId` filter and a bounded time range: + `GET /api/public/v2/observations?filter=&fromStartTime=&toStartTime=`. Parameters ---------- @@ -153,7 +163,12 @@ async def list( request_options: typing.Optional[RequestOptions] = None, ) -> PaginatedSessions: """ - Get sessions + Get sessions. + + This legacy endpoint is not recommended for new data extraction workflows. + Use the v2 observations endpoint with a bounded time range and group rows by + `sessionId` instead: + `GET /api/public/v2/observations?fromStartTime=&toStartTime=`. Parameters ---------- @@ -218,7 +233,12 @@ async def get( request_options: typing.Optional[RequestOptions] = None, ) -> SessionWithTraces: """ - Get a session. Please note that `traces` on this endpoint are not paginated, if you plan to fetch large sessions, consider `GET /api/public/traces?sessionId=` + Get a session. + + Please note that `traces` on this endpoint are not paginated. For large + sessions or new data extraction workflows, use the v2 observations endpoint + with a URL-encoded `sessionId` filter and a bounded time range: + `GET /api/public/v2/observations?filter=&fromStartTime=&toStartTime=`. Parameters ---------- diff --git a/langfuse/api/sessions/raw_client.py b/langfuse/api/sessions/raw_client.py index 9c39a9a5a..e68542051 100644 --- a/langfuse/api/sessions/raw_client.py +++ b/langfuse/api/sessions/raw_client.py @@ -35,7 +35,12 @@ def list( request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[PaginatedSessions]: """ - Get sessions + Get sessions. + + This legacy endpoint is not recommended for new data extraction workflows. + Use the v2 observations endpoint with a bounded time range and group rows by + `sessionId` instead: + `GET /api/public/v2/observations?fromStartTime=&toStartTime=`. Parameters ---------- @@ -162,7 +167,12 @@ def get( request_options: typing.Optional[RequestOptions] = None, ) -> HttpResponse[SessionWithTraces]: """ - Get a session. Please note that `traces` on this endpoint are not paginated, if you plan to fetch large sessions, consider `GET /api/public/traces?sessionId=` + Get a session. + + Please note that `traces` on this endpoint are not paginated. For large + sessions or new data extraction workflows, use the v2 observations endpoint + with a URL-encoded `sessionId` filter and a bounded time range: + `GET /api/public/v2/observations?filter=&fromStartTime=&toStartTime=`. Parameters ---------- @@ -275,7 +285,12 @@ async def list( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[PaginatedSessions]: """ - Get sessions + Get sessions. + + This legacy endpoint is not recommended for new data extraction workflows. + Use the v2 observations endpoint with a bounded time range and group rows by + `sessionId` instead: + `GET /api/public/v2/observations?fromStartTime=&toStartTime=`. Parameters ---------- @@ -402,7 +417,12 @@ async def get( request_options: typing.Optional[RequestOptions] = None, ) -> AsyncHttpResponse[SessionWithTraces]: """ - Get a session. Please note that `traces` on this endpoint are not paginated, if you plan to fetch large sessions, consider `GET /api/public/traces?sessionId=` + Get a session. + + Please note that `traces` on this endpoint are not paginated. For large + sessions or new data extraction workflows, use the v2 observations endpoint + with a URL-encoded `sessionId` filter and a bounded time range: + `GET /api/public/v2/observations?filter=&fromStartTime=&toStartTime=`. Parameters ----------