Skip to content

Commit 7d8d4d8

Browse files
fix(client): fix circular dependencies and offset pagination
1 parent 50f7e6e commit 7d8d4d8

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 107
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/llamastack%2Fllama-stack-client-f252873ea1e1f38fd207331ef2621c511154d5be3f4076e59cc15754fc58eee4.yml
33
openapi_spec_hash: 10cbb4337a06a9fdd7d08612dd6044c3
4-
config_hash: 40b8d777e1eb8b6ab05759b663edd2fb
4+
config_hash: 374d9711288576877a9fabb34e4da7b9

src/pagination.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,15 @@ export class DatasetsIterrows<Item> extends AbstractPage<Item> implements Datase
4848
}
4949

5050
nextPageInfo(): PageInfo | null {
51-
const cursor = this.next_index;
52-
if (!cursor) {
51+
const offset = this.next_index;
52+
if (!offset) {
5353
return null;
5454
}
5555

56-
return {
57-
params: {
58-
start_index: cursor,
59-
},
60-
};
56+
const length = this.getPaginatedItems().length;
57+
const currentCount = offset + length;
58+
59+
return { params: { start_index: currentCount } };
6160
}
6261
}
6362

0 commit comments

Comments
 (0)