google / google/adk-python

Request: More flexible API parameters for session events listing

Offen
#2,854 1 Kommentar 3 Reaktionen 1 zugewiesene Person Beansprucht von @DeanChensj Auf GitHub ansehen
needs review services
Vorherrschende Sprache
Python
Sterne
21.5k
Forks
4k
Ø Merge
1 T. 14 Std.
Gemergte PRs (30 T.)
37

Beschreibung

### Discussed in https://github.com/google/adk-python/discussions/2847

Originally posted by **Artisan2025** September 4, 2025
Current Issue
The current sessions/{session}/events API only supports basic pagination, which creates performance problems when dealing with sessions that have accumulated many events over time.

Current API Limitations
The API currently supports:
pageSize - controls page size
pageToken - for pagination
filter - only timestamp range filtering
Events are returned in ascending order (oldest first), but most use cases need recent events (newest first).

Use Case
When a session has 50,000+ events but we only need the last 10 events, the current API forces us to:
Fetch all 500+ pages of historical data
Load everything into memory
Filter client-side to get the recent events
This is inefficient and doesn't scale well for long-running sessions.
Requested Features
Could the API support more flexible parameters like:
Reverse ordering: order=desc to get newest events first
Result limiting: limit=N to cap the number of results
Smart pagination: When combined with order=desc&limit=10, return only the most recent events without requiring full pagination

Example
Instead of fetching 500 pages:
events
We could have:
10
This would return just the 10 most recent events directly.
Question
Is this type of enhancement possible for the Session Events API? It would significantly improve performance for applications with long-running sessions.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.