feat: enhance API responses with pagination support and model updates#152
feat: enhance API responses with pagination support and model updates#152Joffref wants to merge 7 commits into
Conversation
- Updated the API methods for listing agents, sandboxes, drives, functions, jobs, and job executions to support cursor-based pagination. - Refactored response parsing to return structured lists (e.g., AgentList, SandboxList, DriveList, FunctionList, JobList, JobExecutionList) instead of raw arrays. - Added new parameters for cursor, limit, sort, and anchor to improve query flexibility and response handling. - Updated documentation to reflect changes in response structure and pagination capabilities. This change improves the API's usability and aligns with the latest versioning standards.
🧪 Testing GuideWhat this PR addressesThis PR adds cursor-based pagination support to all major list endpoints in the Python SDK (agents, sandboxes, drives, functions, jobs, models, policies, volumes). Response parsing is refactored from returning raw arrays to returning structured list objects ( Steps to reproduce / exercise the new behavior
What to verify (expected behavior)
Note Posted by PR Testing Guide · Tag @mendral-app with feedback. |
There was a problem hiding this comment.
LGTM
The previously flagged from_dict guard issue has been fully resolved — all *List models now handle bare arrays via isinstance(src_dict, list) wrapping, None via early return, and empty dicts safely. No new issues found.
Tag @mendral-app with feedback or questions. View session
# Conflicts: # src/blaxel/core/sandbox/default/sandbox.py # src/blaxel/core/sandbox/sync/sandbox.py
list_response_items now lives in common.internal (was duplicated in four wrappers); adds unwrap unit tests, a jobs list regression test, and success-status non-JSON parse coverage.
*Listobjects, preserving the legacy return shape until the platform migration completesResponseParseError(status, content type, body preview) instead ofJSONDecodeError(ENG-2802)Version pinning + auto-paging iterators (#145's design) remain follow-up; this is the bridge.