@@ -14,6 +14,16 @@ import * as Opts from './internal/request-options';
1414import  *  as  qs  from  './internal/qs' ; 
1515import  {  VERSION  }  from  './version' ; 
1616import  *  as  Errors  from  './core/error' ; 
17+ import  *  as  Pagination  from  './core/pagination' ; 
18+ import  { 
19+   AbstractPage , 
20+   type  ArrayPageParams , 
21+   ArrayPageResponse , 
22+   type  NextFilesPageParams , 
23+   NextFilesPageResponse , 
24+   type  ObjectPageParams , 
25+   ObjectPageResponse , 
26+ }  from  './core/pagination' ; 
1727import  *  as  Uploads  from  './core/uploads' ; 
1828import  *  as  API  from  './resources/index' ; 
1929import  *  as  TopLevelAPI  from  './resources/top-level' ; 
@@ -23,12 +33,12 @@ import {
2333  Archive , 
2434  ArchiveCreateParams , 
2535  ArchiveListParams , 
26-   ArchiveListResponse , 
2736  ArchiveUpdateParams , 
2837  Archives , 
38+   ArchivesArrayPage , 
2939  VectorDBProvider , 
3040}  from  './resources/archives' ; 
31- import  {  TagListParams ,  TagListResponse ,  Tags  }  from  './resources/tags' ; 
41+ import  {  TagListParams ,  TagListResponse ,  TagListResponsesArrayPage ,   Tags  }  from  './resources/tags' ; 
3242import  { 
3343  NpmRequirement , 
3444  PipRequirement , 
@@ -39,13 +49,13 @@ import {
3949  ToolCreateParams , 
4050  ToolDeleteResponse , 
4151  ToolListParams , 
42-   ToolListResponse , 
4352  ToolReturnMessage , 
4453  ToolType , 
4554  ToolUpdateParams , 
4655  ToolUpsertBaseToolsResponse , 
4756  ToolUpsertParams , 
4857  Tools , 
58+   ToolsArrayPage , 
4959}  from  './resources/tools' ; 
5060import  { 
5161  AgentCountResponse , 
@@ -57,9 +67,9 @@ import {
5767  AgentImportFileParams , 
5868  AgentImportFileResponse , 
5969  AgentListParams , 
60-   AgentListResponse , 
6170  AgentRetrieveParams , 
6271  AgentState , 
72+   AgentStatesArrayPage , 
6373  AgentType , 
6474  AgentUpdateParams , 
6575  Agents , 
@@ -82,16 +92,15 @@ import {
8292  BatchCancelResponse , 
8393  BatchCreateParams , 
8494  BatchJob , 
95+   BatchJobsArrayPage , 
8596  BatchListParams , 
86-   BatchListResponse , 
8797  Batches , 
8898}  from  './resources/batches/batches' ; 
8999import  { 
90100  BlockCountResponse , 
91101  BlockCreateParams , 
92102  BlockDeleteResponse , 
93103  BlockListParams , 
94-   BlockListResponse , 
95104  BlockUpdateParams , 
96105  Blocks , 
97106  CreateBlock , 
@@ -102,9 +111,9 @@ import {
102111  FolderCreateParams , 
103112  FolderDeleteResponse , 
104113  FolderListParams , 
105-   FolderListResponse , 
106114  FolderUpdateParams , 
107115  Folders , 
116+   FoldersArrayPage , 
108117}  from  './resources/folders/folders' ; 
109118import  { 
110119  DynamicManager , 
@@ -113,9 +122,9 @@ import {
113122  GroupCreateParams , 
114123  GroupDeleteResponse , 
115124  GroupListParams , 
116-   GroupListResponse , 
117125  GroupUpdateParams , 
118126  Groups , 
127+   GroupsArrayPage , 
119128  ManagerType , 
120129  RoundRobinManager , 
121130  SleeptimeManager , 
@@ -124,12 +133,12 @@ import {
124133}  from  './resources/groups/groups' ; 
125134import  { 
126135  Identities , 
136+   IdentitiesArrayPage , 
127137  Identity , 
128138  IdentityCountResponse , 
129139  IdentityCreateParams , 
130140  IdentityDeleteResponse , 
131141  IdentityListParams , 
132-   IdentityListResponse , 
133142  IdentityProperty , 
134143  IdentityType , 
135144  IdentityUpdateParams , 
@@ -144,8 +153,8 @@ import {
144153  ProviderCategory , 
145154  ProviderType , 
146155}  from  './resources/models/models' ; 
147- import  {  Job ,  RunListParams ,  RunListResponse ,   Runs ,  StopReasonType  }  from  './resources/runs/runs' ; 
148- import  {  ProviderTrace ,  Step ,  StepListParams ,  StepListResponse ,   Steps  }  from  './resources/steps/steps' ; 
156+ import  {  Job ,  RunListParams ,  Runs ,  StopReasonType  }  from  './resources/runs/runs' ; 
157+ import  {  ProviderTrace ,  Step ,  StepListParams ,  Steps ,   StepsArrayPage  }  from  './resources/steps/steps' ; 
149158import  {  Templates  }  from  './resources/templates/templates' ; 
150159import  {  type  Fetch  }  from  './internal/builtin-types' ; 
151160import  {  HeadersLike ,  NullableHeaders ,  buildHeaders  }  from  './internal/headers' ; 
@@ -627,6 +636,25 @@ export class Letta {
627636    return  {  response,  options,  controller,  requestLogID,  retryOfRequestLogID,  startTime } ; 
628637  } 
629638
639+   getAPIList < Item ,  PageClass  extends  Pagination . AbstractPage < Item >  =  Pagination . AbstractPage < Item > > ( 
640+     path : string , 
641+     Page : new  ( ...args : any [ ] )  =>  PageClass , 
642+     opts ?: RequestOptions , 
643+   ) : Pagination . PagePromise < PageClass ,  Item >  { 
644+     return  this . requestAPIList ( Page ,  {  method : 'get' ,  path,  ...opts  } ) ; 
645+   } 
646+ 
647+   requestAPIList < 
648+     Item  =  unknown , 
649+     PageClass  extends  Pagination . AbstractPage < Item >  =  Pagination . AbstractPage < Item > , 
650+   > ( 
651+     Page : new  ( ...args : ConstructorParameters < typeof  Pagination . AbstractPage > )  =>  PageClass , 
652+     options : FinalRequestOptions , 
653+   ) : Pagination . PagePromise < PageClass ,  Item >  { 
654+     const  request  =  this . makeRequest ( options ,  null ,  undefined ) ; 
655+     return  new  Pagination . PagePromise < PageClass ,  Item > ( this  as  any  as  Letta ,  request ,  Page ) ; 
656+   } 
657+ 
630658  async  fetchWithTimeout ( 
631659    url : RequestInfo , 
632660    init : RequestInit  |  undefined , 
@@ -891,13 +919,25 @@ Letta.Templates = Templates;
891919export  declare  namespace  Letta  { 
892920  export  type  RequestOptions  =  Opts . RequestOptions ; 
893921
922+   export  import  ArrayPage  =  Pagination . ArrayPage ; 
923+   export  {  type  ArrayPageParams  as  ArrayPageParams ,  type  ArrayPageResponse  as  ArrayPageResponse  } ; 
924+ 
925+   export  import  ObjectPage  =  Pagination . ObjectPage ; 
926+   export  {  type  ObjectPageParams  as  ObjectPageParams ,  type  ObjectPageResponse  as  ObjectPageResponse  } ; 
927+ 
928+   export  import  NextFilesPage  =  Pagination . NextFilesPage ; 
929+   export  { 
930+     type  NextFilesPageParams  as  NextFilesPageParams , 
931+     type  NextFilesPageResponse  as  NextFilesPageResponse , 
932+   } ; 
933+ 
894934  export  {  type  HealthResponse  as  HealthResponse  } ; 
895935
896936  export  { 
897937    Archives  as  Archives , 
898938    type  Archive  as  Archive , 
899939    type  VectorDBProvider  as  VectorDBProvider , 
900-     type  ArchiveListResponse  as  ArchiveListResponse , 
940+     type  ArchivesArrayPage  as  ArchivesArrayPage , 
901941    type  ArchiveCreateParams  as  ArchiveCreateParams , 
902942    type  ArchiveUpdateParams  as  ArchiveUpdateParams , 
903943    type  ArchiveListParams  as  ArchiveListParams , 
@@ -911,10 +951,10 @@ export declare namespace Letta {
911951    type  ToolCreate  as  ToolCreate , 
912952    type  ToolReturnMessage  as  ToolReturnMessage , 
913953    type  ToolType  as  ToolType , 
914-     type  ToolListResponse  as  ToolListResponse , 
915954    type  ToolDeleteResponse  as  ToolDeleteResponse , 
916955    type  ToolCountResponse  as  ToolCountResponse , 
917956    type  ToolUpsertBaseToolsResponse  as  ToolUpsertBaseToolsResponse , 
957+     type  ToolsArrayPage  as  ToolsArrayPage , 
918958    type  ToolCreateParams  as  ToolCreateParams , 
919959    type  ToolUpdateParams  as  ToolUpdateParams , 
920960    type  ToolListParams  as  ToolListParams , 
@@ -925,9 +965,9 @@ export declare namespace Letta {
925965  export  { 
926966    Folders  as  Folders , 
927967    type  Folder  as  Folder , 
928-     type  FolderListResponse  as  FolderListResponse , 
929968    type  FolderDeleteResponse  as  FolderDeleteResponse , 
930969    type  FolderCountResponse  as  FolderCountResponse , 
970+     type  FoldersArrayPage  as  FoldersArrayPage , 
931971    type  FolderCreateParams  as  FolderCreateParams , 
932972    type  FolderUpdateParams  as  FolderUpdateParams , 
933973    type  FolderListParams  as  FolderListParams , 
@@ -952,11 +992,11 @@ export declare namespace Letta {
952992    type  RequiresApprovalToolRule  as  RequiresApprovalToolRule , 
953993    type  TerminalToolRule  as  TerminalToolRule , 
954994    type  TextResponseFormat  as  TextResponseFormat , 
955-     type  AgentListResponse  as  AgentListResponse , 
956995    type  AgentDeleteResponse  as  AgentDeleteResponse , 
957996    type  AgentCountResponse  as  AgentCountResponse , 
958997    type  AgentExportFileResponse  as  AgentExportFileResponse , 
959998    type  AgentImportFileResponse  as  AgentImportFileResponse , 
999+     type  AgentStatesArrayPage  as  AgentStatesArrayPage , 
9601000    type  AgentCreateParams  as  AgentCreateParams , 
9611001    type  AgentRetrieveParams  as  AgentRetrieveParams , 
9621002    type  AgentUpdateParams  as  AgentUpdateParams , 
@@ -974,9 +1014,9 @@ export declare namespace Letta {
9741014    type  SleeptimeManager  as  SleeptimeManager , 
9751015    type  SupervisorManager  as  SupervisorManager , 
9761016    type  VoiceSleeptimeManager  as  VoiceSleeptimeManager , 
977-     type  GroupListResponse  as  GroupListResponse , 
9781017    type  GroupDeleteResponse  as  GroupDeleteResponse , 
9791018    type  GroupCountResponse  as  GroupCountResponse , 
1019+     type  GroupsArrayPage  as  GroupsArrayPage , 
9801020    type  GroupCreateParams  as  GroupCreateParams , 
9811021    type  GroupUpdateParams  as  GroupUpdateParams , 
9821022    type  GroupListParams  as  GroupListParams , 
@@ -987,9 +1027,9 @@ export declare namespace Letta {
9871027    type  Identity  as  Identity , 
9881028    type  IdentityProperty  as  IdentityProperty , 
9891029    type  IdentityType  as  IdentityType , 
990-     type  IdentityListResponse  as  IdentityListResponse , 
9911030    type  IdentityDeleteResponse  as  IdentityDeleteResponse , 
9921031    type  IdentityCountResponse  as  IdentityCountResponse , 
1032+     type  IdentitiesArrayPage  as  IdentitiesArrayPage , 
9931033    type  IdentityCreateParams  as  IdentityCreateParams , 
9941034    type  IdentityUpdateParams  as  IdentityUpdateParams , 
9951035    type  IdentityListParams  as  IdentityListParams , 
@@ -1009,7 +1049,6 @@ export declare namespace Letta {
10091049  export  { 
10101050    Blocks  as  Blocks , 
10111051    type  CreateBlock  as  CreateBlock , 
1012-     type  BlockListResponse  as  BlockListResponse , 
10131052    type  BlockDeleteResponse  as  BlockDeleteResponse , 
10141053    type  BlockCountResponse  as  BlockCountResponse , 
10151054    type  BlockCreateParams  as  BlockCreateParams , 
@@ -1021,25 +1060,29 @@ export declare namespace Letta {
10211060    Runs  as  Runs , 
10221061    type  Job  as  Job , 
10231062    type  StopReasonType  as  StopReasonType , 
1024-     type  RunListResponse  as  RunListResponse , 
10251063    type  RunListParams  as  RunListParams , 
10261064  } ; 
10271065
10281066  export  { 
10291067    Steps  as  Steps , 
10301068    type  ProviderTrace  as  ProviderTrace , 
10311069    type  Step  as  Step , 
1032-     type  StepListResponse  as  StepListResponse , 
1070+     type  StepsArrayPage  as  StepsArrayPage , 
10331071    type  StepListParams  as  StepListParams , 
10341072  } ; 
10351073
1036-   export  {  Tags  as  Tags ,  type  TagListResponse  as  TagListResponse ,  type  TagListParams  as  TagListParams  } ; 
1074+   export  { 
1075+     Tags  as  Tags , 
1076+     type  TagListResponse  as  TagListResponse , 
1077+     type  TagListResponsesArrayPage  as  TagListResponsesArrayPage , 
1078+     type  TagListParams  as  TagListParams , 
1079+   } ; 
10371080
10381081  export  { 
10391082    Batches  as  Batches , 
10401083    type  BatchJob  as  BatchJob , 
1041-     type  BatchListResponse  as  BatchListResponse , 
10421084    type  BatchCancelResponse  as  BatchCancelResponse , 
1085+     type  BatchJobsArrayPage  as  BatchJobsArrayPage , 
10431086    type  BatchCreateParams  as  BatchCreateParams , 
10441087    type  BatchListParams  as  BatchListParams , 
10451088  } ; 
0 commit comments