@@ -67,8 +67,24 @@ func (r *VectorStoreFileBatchService) Get(ctx context.Context, batchID string, q
67
67
return
68
68
}
69
69
70
+ // Cancels a vector store file batch.
71
+ func (r * VectorStoreFileBatchService ) Cancel (ctx context.Context , batchID string , body VectorStoreFileBatchCancelParams , opts ... option.RequestOption ) (res * VectorStoreFileBatches , err error ) {
72
+ opts = slices .Concat (r .Options , opts )
73
+ if body .VectorStoreID == "" {
74
+ err = errors .New ("missing required vector_store_id parameter" )
75
+ return
76
+ }
77
+ if batchID == "" {
78
+ err = errors .New ("missing required batch_id parameter" )
79
+ return
80
+ }
81
+ path := fmt .Sprintf ("v1/vector_stores/%s/file_batches/%s/cancel" , body .VectorStoreID , batchID )
82
+ err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , nil , & res , opts ... )
83
+ return
84
+ }
85
+
70
86
// Returns a list of vector store files in a batch.
71
- func (r * VectorStoreFileBatchService ) List (ctx context.Context , batchID string , params VectorStoreFileBatchListParams , opts ... option.RequestOption ) (res * pagination.OpenAICursorPage [VectorStoreFile ], err error ) {
87
+ func (r * VectorStoreFileBatchService ) ListFiles (ctx context.Context , batchID string , params VectorStoreFileBatchListFilesParams , opts ... option.RequestOption ) (res * pagination.OpenAICursorPage [VectorStoreFile ], err error ) {
72
88
var raw * http.Response
73
89
opts = slices .Concat (r .Options , opts )
74
90
opts = append ([]option.RequestOption {option .WithResponseInto (& raw )}, opts ... )
@@ -94,24 +110,8 @@ func (r *VectorStoreFileBatchService) List(ctx context.Context, batchID string,
94
110
}
95
111
96
112
// Returns a list of vector store files in a batch.
97
- func (r * VectorStoreFileBatchService ) ListAutoPaging (ctx context.Context , batchID string , params VectorStoreFileBatchListParams , opts ... option.RequestOption ) * pagination.OpenAICursorPageAutoPager [VectorStoreFile ] {
98
- return pagination .NewOpenAICursorPageAutoPager (r .List (ctx , batchID , params , opts ... ))
99
- }
100
-
101
- // Cancels a vector store file batch.
102
- func (r * VectorStoreFileBatchService ) Cancel (ctx context.Context , batchID string , body VectorStoreFileBatchCancelParams , opts ... option.RequestOption ) (res * VectorStoreFileBatches , err error ) {
103
- opts = slices .Concat (r .Options , opts )
104
- if body .VectorStoreID == "" {
105
- err = errors .New ("missing required vector_store_id parameter" )
106
- return
107
- }
108
- if batchID == "" {
109
- err = errors .New ("missing required batch_id parameter" )
110
- return
111
- }
112
- path := fmt .Sprintf ("v1/vector_stores/%s/file_batches/%s/cancel" , body .VectorStoreID , batchID )
113
- err = requestconfig .ExecuteNewRequest (ctx , http .MethodPost , path , nil , & res , opts ... )
114
- return
113
+ func (r * VectorStoreFileBatchService ) ListFilesAutoPaging (ctx context.Context , batchID string , params VectorStoreFileBatchListFilesParams , opts ... option.RequestOption ) * pagination.OpenAICursorPageAutoPager [VectorStoreFile ] {
114
+ return pagination .NewOpenAICursorPageAutoPager (r .ListFiles (ctx , batchID , params , opts ... ))
115
115
}
116
116
117
117
// Response from listing files in a vector store file batch.
@@ -388,7 +388,12 @@ type VectorStoreFileBatchGetParams struct {
388
388
paramObj
389
389
}
390
390
391
- type VectorStoreFileBatchListParams struct {
391
+ type VectorStoreFileBatchCancelParams struct {
392
+ VectorStoreID string `path:"vector_store_id,required" json:"-"`
393
+ paramObj
394
+ }
395
+
396
+ type VectorStoreFileBatchListFilesParams struct {
392
397
VectorStoreID string `path:"vector_store_id,required" json:"-"`
393
398
// A cursor for use in pagination. `after` is an object ID that defines your place
394
399
// in the list.
@@ -407,16 +412,11 @@ type VectorStoreFileBatchListParams struct {
407
412
paramObj
408
413
}
409
414
410
- // URLQuery serializes [VectorStoreFileBatchListParams ]'s query parameters as
415
+ // URLQuery serializes [VectorStoreFileBatchListFilesParams ]'s query parameters as
411
416
// `url.Values`.
412
- func (r VectorStoreFileBatchListParams ) URLQuery () (v url.Values , err error ) {
417
+ func (r VectorStoreFileBatchListFilesParams ) URLQuery () (v url.Values , err error ) {
413
418
return apiquery .MarshalWithSettings (r , apiquery.QuerySettings {
414
419
ArrayFormat : apiquery .ArrayQueryFormatComma ,
415
420
NestedFormat : apiquery .NestedQueryFormatBrackets ,
416
421
})
417
422
}
418
-
419
- type VectorStoreFileBatchCancelParams struct {
420
- VectorStoreID string `path:"vector_store_id,required" json:"-"`
421
- paramObj
422
- }
0 commit comments