File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 11configured_endpoints : 69
2- openapi_spec_url : https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-7c699d4503077d06a4a44f52c0c1f902d19a87c766b8be75b97c8dfd484ad4aa .yml
2+ openapi_spec_url : https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-dfb00c627f58e5180af7a9b29ed2f2aa0764a3b9daa6a32a1cc45bc8e48dfe15 .yml
Original file line number Diff line number Diff line change @@ -145,6 +145,8 @@ export class Page<Item> extends AbstractPage<Item> implements PageResponse<Item>
145145
146146export interface CursorPageResponse < Item > {
147147 data : Array < Item > ;
148+
149+ has_more : boolean ;
148150}
149151
150152export interface CursorPageParams {
@@ -159,6 +161,8 @@ export class CursorPage<Item extends { id: string }>
159161{
160162 data : Array < Item > ;
161163
164+ has_more : boolean ;
165+
162166 constructor (
163167 client : OpenAI ,
164168 response : Response ,
@@ -168,12 +172,21 @@ export class CursorPage<Item extends { id: string }>
168172 super ( client , response , body , options ) ;
169173
170174 this . data = body . data || [ ] ;
175+ this . has_more = body . has_more || false ;
171176 }
172177
173178 getPaginatedItems ( ) : Item [ ] {
174179 return this . data ?? [ ] ;
175180 }
176181
182+ override hasNextPage ( ) {
183+ if ( this . has_more === false ) {
184+ return false ;
185+ }
186+
187+ return super . hasNextPage ( ) ;
188+ }
189+
177190 nextPageRequestOptions ( ) : PageRequestOptions | null {
178191 const data = this . getPaginatedItems ( ) ;
179192 const id = data [ data . length - 1 ] ?. id ;
You can’t perform that action at this time.
0 commit comments