google / google/adk-python

Request: More flexible API parameters for session events listing

未关闭
#2,854 1 条评论 3 个 reaction 已指派 1 人 已被 @DeanChensj 认领 在 GitHub 查看
needs review services
主要语言
Python
星标
21.5k
派生
4k
平均合并
1 天 14 小时
30 天内合并 PR
37

描述

### 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.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。