Skip to content

Commit 712b664

Browse files
feat: add support for limit query parameter
1 parent 7f852ba commit 712b664

File tree

3 files changed

+73
-2
lines changed

3 files changed

+73
-2
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 11
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/turbopuffer-benesch%2Fturbopuffer-8f6363d984eadd23f3dd12e8607be864813cfe08a3a86df083bcabc07e5f9553.yml
3-
openapi_spec_hash: 4dc391a593c54bc32ae5f0a73a45e2b6
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/turbopuffer-benesch%2Fturbopuffer-1c3d2e045078b0ae0c1b6e233f8b437002bfcc0cfc5476a55e7363a9b41772c5.yml
3+
openapi_spec_hash: 56a385c701bc60fab06857b4bcdeee2a
44
config_hash: f55839cc66fb5661bc3292f5f3ac48cf

src/resources/namespaces.ts

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,11 @@ export interface Query {
473473
*/
474474
include_attributes?: IncludeAttributes;
475475

476+
/**
477+
* Limit configuration for query results.
478+
*/
479+
limit?: number | Query.Limit;
480+
476481
/**
477482
* How to rank the documents in the namespace.
478483
*/
@@ -484,6 +489,25 @@ export interface Query {
484489
top_k?: number;
485490
}
486491

492+
export namespace Query {
493+
export interface Limit {
494+
/**
495+
* The total number of results to return.
496+
*/
497+
total: number;
498+
499+
per?: Limit.Per;
500+
}
501+
502+
export namespace Limit {
503+
export interface Per {
504+
attributes: Array<string>;
505+
506+
limit: number;
507+
}
508+
}
509+
}
510+
487511
/**
488512
* The billing information for a query.
489513
*/
@@ -836,6 +860,11 @@ export interface NamespaceExplainQueryParams {
836860
*/
837861
include_attributes?: IncludeAttributes;
838862

863+
/**
864+
* Body param: Limit configuration for query results.
865+
*/
866+
limit?: number | NamespaceExplainQueryParams.Limit;
867+
839868
/**
840869
* Body param: How to rank the documents in the namespace.
841870
*/
@@ -867,6 +896,23 @@ export namespace NamespaceExplainQueryParams {
867896
*/
868897
level?: 'strong' | 'eventual';
869898
}
899+
900+
export interface Limit {
901+
/**
902+
* The total number of results to return.
903+
*/
904+
total: number;
905+
906+
per?: Limit.Per;
907+
}
908+
909+
export namespace Limit {
910+
export interface Per {
911+
attributes: Array<string>;
912+
913+
limit: number;
914+
}
915+
}
870916
}
871917

872918
export interface NamespaceHintCacheWarmParams {
@@ -967,6 +1013,11 @@ export interface NamespaceQueryParams {
9671013
*/
9681014
include_attributes?: IncludeAttributes;
9691015

1016+
/**
1017+
* Body param: Limit configuration for query results.
1018+
*/
1019+
limit?: number | NamespaceQueryParams.Limit;
1020+
9701021
/**
9711022
* Body param: How to rank the documents in the namespace.
9721023
*/
@@ -998,6 +1049,23 @@ export namespace NamespaceQueryParams {
9981049
*/
9991050
level?: 'strong' | 'eventual';
10001051
}
1052+
1053+
export interface Limit {
1054+
/**
1055+
* The total number of results to return.
1056+
*/
1057+
total: number;
1058+
1059+
per?: Limit.Per;
1060+
}
1061+
1062+
export namespace Limit {
1063+
export interface Per {
1064+
attributes: Array<string>;
1065+
1066+
limit: number;
1067+
}
1068+
}
10011069
}
10021070

10031071
export interface NamespaceRecallParams {

tests/api-resources/namespaces.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ describe('resource namespaces', () => {
4646
exclude_attributes: ['string'],
4747
group_by: ['string'],
4848
include_attributes: true,
49+
limit: 0,
4950
top_k: 0,
5051
vector_encoding: 'float',
5152
});
@@ -109,6 +110,7 @@ describe('resource namespaces', () => {
109110
exclude_attributes: ['string'],
110111
group_by: ['string'],
111112
include_attributes: true,
113+
limit: 0,
112114
rank_by: ['id', 'asc'],
113115
top_k: 0,
114116
},
@@ -139,6 +141,7 @@ describe('resource namespaces', () => {
139141
exclude_attributes: ['string'],
140142
group_by: ['string'],
141143
include_attributes: true,
144+
limit: 0,
142145
rank_by: ['id', 'asc'],
143146
top_k: 0,
144147
vector_encoding: 'float',

0 commit comments

Comments
 (0)