Repository navigation
Conversation
The server gained `offset` on both listing endpoints and the pagination was
reachable only by hand. Every method in both SDKs returned just `results`, so a
caller had no way to ask for the next page: `recall(query, owner, limit=5)` could
only ever fetch the first five.
- Python `recall` / `list_memories` (sync and async) and Node `recall` /
`listMemories` take `offset`, defaulted to 0, so existing calls are unchanged.
- Docstrings and both READMEs say what the caller needs to page correctly: a page
shorter than `limit` is the last one, and the response's `has_more` is reachable
through the underlying session/fetch for callers who want it explicitly. The
methods keep returning the cells rather than changing to a dict, because a
return-type change is a break and `len(page) < limit` is the convention every
paginated API already uses.
- Tests assert on the request the client actually makes. The first version of the
Node test built the request body inside the test and asserted on it - it would
have passed with `offset` deleted from the client, which is worse than no test.
Replaced with a captured `fetch`: `recall` with `{offset: 10}` has to put 10 in
the body it sends, and `listMemories` has to put it in the query string. The
Python tests do the same through the mocked `httpx.AsyncClient` / `requests`
seam the existing suite already uses.
Owner
Author
|
Landed on master in the v0.1.0 chain: the branch was fast-forward merged as part of |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(sdk): page from a client, not only from curl
The server gained
offseton both listing endpoints and the pagination wasreachable only by hand. Every method in both SDKs returned just
results, so acaller had no way to ask for the next page:
recall(query, owner, limit=5)couldonly ever fetch the first five.
recall/list_memories(sync and async) and Noderecall/listMemoriestakeoffset, defaulted to 0, so existing calls are unchanged.shorter than
limitis the last one, and the response'shas_moreis reachablethrough the underlying session/fetch for callers who want it explicitly. The
methods keep returning the cells rather than changing to a dict, because a
return-type change is a break and
len(page) < limitis the convention everypaginated API already uses.
Node test built the request body inside the test and asserted on it - it would
have passed with
offsetdeleted from the client, which is worse than no test.Replaced with a captured
fetch:recallwith{offset: 10}has to put 10 inthe body it sends, and
listMemorieshas to put it in the query string. ThePython tests do the same through the mocked
httpx.AsyncClient/requestsseam the existing suite already uses.