Skip to content

Commit 667134c

Browse files
committed
Add parameters to vector store list functions
1 parent ebbc0e6 commit 667134c

9 files changed

+36
-24
lines changed

src/Contracts/Resources/VectorStoresContract.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,17 @@ public function create(array $parameters): VectorStoreResponse;
2121
* Returns a list of vector stores.
2222
*
2323
* @see https://platform.openai.com/docs/api-reference/vector-stores/list
24+
*
25+
* @param array<string, mixed> $parameters
2426
*/
25-
public function list(): VectorStoreListResponse;
27+
public function list(array $parameters = []): VectorStoreListResponse;
2628

2729
/**
2830
* Retrieves a vector store.
2931
*
3032
* @see https://platform.openai.com/docs/api-reference/vector-stores/retrieve
3133
*/
32-
public function retrieve(string $vectorStore): VectorStoreResponse;
34+
public function retrieve(string $vectorStoreId): VectorStoreResponse;
3335

3436
/**
3537
* Modify a vector store
@@ -38,14 +40,14 @@ public function retrieve(string $vectorStore): VectorStoreResponse;
3840
*
3941
* @param array<string, mixed> $parameters
4042
*/
41-
public function modify(string $vectorStore, array $parameters): VectorStoreResponse;
43+
public function modify(string $vectorStoreId, array $parameters): VectorStoreResponse;
4244

4345
/**
4446
* Delete a vector store.
4547
*
4648
* https://platform.openai.com/docs/api-reference/vector-stores/delete
4749
*/
48-
public function delete(string $vectorStore): VectorStoreDeleteResponse;
50+
public function delete(string $vectorStoreId): VectorStoreDeleteResponse;
4951

5052
/**
5153
* Manage the files related to the vector store

src/Contracts/Resources/VectorStoresFileBatchesContract.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ public function cancel(string $vectorStoreId, string $fileBatchId): VectorStoreF
3434
* Lists the files within a file batch within a vector store
3535
*
3636
* @see https://platform.openai.com/docs/api-reference/vector-stores-file-batches/listBatchFiles
37+
*
38+
* @param array<string, mixed> $parameters
3739
*/
38-
public function listFiles(string $vectorStoreId, string $fileBatchId): VectorStoreFileListResponse;
40+
public function listFiles(string $vectorStoreId, string $fileBatchId, array $parameters = []): VectorStoreFileListResponse;
3941
}

src/Contracts/Resources/VectorStoresFilesContract.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ public function create(string $vectorStoreId, array $parameters): VectorStoreFil
2121
* Returns a list of files within a vector store.
2222
*
2323
* @see https://platform.openai.com/docs/api-reference/vector-stores-files/listFiles
24+
*
25+
* @param array<string, mixed> $parameters
2426
*/
25-
public function list(string $vectorStoreId): VectorStoreFileListResponse;
27+
public function list(string $vectorStoreId, array $parameters = []): VectorStoreFileListResponse;
2628

2729
/**
2830
* Retrieves a file within a vector store.

src/Resources/VectorStores.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,12 @@ public function create(array $parameters): VectorStoreResponse
3838
* Returns a list of vector stores.
3939
*
4040
* @see https://platform.openai.com/docs/api-reference/vector-stores/list
41+
*
42+
* @param array<string, mixed> $parameters
4143
*/
42-
public function list(): VectorStoreListResponse
44+
public function list(array $parameters = []): VectorStoreListResponse
4345
{
44-
$payload = Payload::list('vector_stores');
46+
$payload = Payload::list('vector_stores', $parameters);
4547

4648
/** @var Response<array{object: string, data: array<int, array{id: string, object: string, created_at: int, name: ?string, usage_bytes: int, file_counts: array{in_progress: int, completed: int, failed: int, cancelled: int, total: int}, status: string, expires_after: ?array{anchor: string, days: int}, expires_at: ?int, last_active_at: ?int, metadata: array<string, string>}>, first_id: ?string, last_id: ?string, has_more: bool}> $response */
4749
$response = $this->transporter->requestObject($payload);
@@ -54,9 +56,9 @@ public function list(): VectorStoreListResponse
5456
*
5557
* @see https://platform.openai.com/docs/api-reference/vector-stores/retrieve
5658
*/
57-
public function retrieve(string $vectorStore): VectorStoreResponse
59+
public function retrieve(string $vectorStoreId): VectorStoreResponse
5860
{
59-
$payload = Payload::retrieve('vector_stores', $vectorStore);
61+
$payload = Payload::retrieve('vector_stores', $vectorStoreId);
6062

6163
/** @var Response<array{id: string, object: string, created_at: int, name: ?string, usage_bytes: int, file_counts: array{in_progress: int, completed: int, failed: int, cancelled: int, total: int}, status: string, expires_after: ?array{anchor: string, days: int}, expires_at: ?int, last_active_at: ?int, metadata: array<string, string>}> $response */
6264
$response = $this->transporter->requestObject($payload);
@@ -71,9 +73,9 @@ public function retrieve(string $vectorStore): VectorStoreResponse
7173
*
7274
* @param array<string, mixed> $parameters
7375
*/
74-
public function modify(string $vectorStore, array $parameters): VectorStoreResponse
76+
public function modify(string $vectorStoreId, array $parameters): VectorStoreResponse
7577
{
76-
$payload = Payload::modify('vector_stores', $vectorStore, $parameters);
78+
$payload = Payload::modify('vector_stores', $vectorStoreId, $parameters);
7779

7880
/** @var Response<array{id: string, object: string, created_at: int, name: ?string, usage_bytes: int, file_counts: array{in_progress: int, completed: int, failed: int, cancelled: int, total: int}, status: string, expires_after: ?array{anchor: string, days: int}, expires_at: ?int, last_active_at: ?int, metadata: array<string, string>}> $response */
7981
$response = $this->transporter->requestObject($payload);
@@ -86,9 +88,9 @@ public function modify(string $vectorStore, array $parameters): VectorStoreRespo
8688
*
8789
* https://platform.openai.com/docs/api-reference/vector-stores/delete
8890
*/
89-
public function delete(string $vectorStore): VectorStoreDeleteResponse
91+
public function delete(string $vectorStoreId): VectorStoreDeleteResponse
9092
{
91-
$payload = Payload::delete('vector_stores', $vectorStore);
93+
$payload = Payload::delete('vector_stores', $vectorStoreId);
9294

9395
/** @var Response<array{id: string, object: string, deleted: bool}> $response */
9496
$response = $this->transporter->requestObject($payload);

src/Resources/VectorStoresFileBatches.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,12 @@ public function retrieve(string $vectorStoreId, string $fileBatchId): VectorStor
5050
* Lists the files within a file batch within a vector store
5151
*
5252
* @see https://platform.openai.com/docs/api-reference/vector-stores-file-batches/listBatchFiles
53+
*
54+
* @param array<string, mixed> $parameters
5355
*/
54-
public function listFiles(string $vectorStoreId, string $fileBatchId): VectorStoreFileListResponse
56+
public function listFiles(string $vectorStoreId, string $fileBatchId, array $parameters = []): VectorStoreFileListResponse
5557
{
56-
$payload = Payload::list("vector_stores/$vectorStoreId/file_batches/$fileBatchId/files");
58+
$payload = Payload::list("vector_stores/$vectorStoreId/file_batches/$fileBatchId/files", $parameters);
5759

5860
/** @var Response<array{object: string, data: array<int, array{id: string, object: string, usage_bytes: int, created_at: int, vector_store_id: string, status: string, last_error: ?array{code: string, message: string}, chunking_strategy: array{type: 'static', static: array{max_chunk_size_tokens: int, chunk_overlap_tokens: int}}|array{type: 'other'}}>, first_id: ?string, last_id: ?string, has_more: bool}> $response */
5961
$response = $this->transporter->requestObject($payload);

src/Resources/VectorStoresFiles.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@ public function create(string $vectorStoreId, array $parameters): VectorStoreFil
3636
* Returns a list of files within a vector store.
3737
*
3838
* @see https://platform.openai.com/docs/api-reference/vector-stores-files/listFiles
39+
*
40+
* @param array<string, mixed> $parameters
3941
*/
40-
public function list(string $vectorStoreId): VectorStoreFileListResponse
42+
public function list(string $vectorStoreId, array $parameters = []): VectorStoreFileListResponse
4143
{
42-
$payload = Payload::list("vector_stores/$vectorStoreId/files");
44+
$payload = Payload::list("vector_stores/$vectorStoreId/files", $parameters);
4345

4446
/** @var Response<array{object: string, data: array<int, array{id: string, object: string, usage_bytes: int, created_at: int, vector_store_id: string, status: string, last_error: ?array{code: string, message: string}, chunking_strategy: array{type: 'static', static: array{max_chunk_size_tokens: int, chunk_overlap_tokens: int}}|array{type: 'other'}}>, first_id: ?string, last_id: ?string, has_more: bool}> $response */
4547
$response = $this->transporter->requestObject($payload);

src/Testing/Resources/VectorStoresFileBatchesTestResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function create(string $vectorStoreId, array $parameters): VectorStoreFil
3232
return $this->record(__FUNCTION__, func_get_args());
3333
}
3434

35-
public function listFiles(string $vectorStoreId, string $fileBatchId): VectorStoreFileListResponse
35+
public function listFiles(string $vectorStoreId, string $fileBatchId, array $parameters = []): VectorStoreFileListResponse
3636
{
3737
return $this->record(__FUNCTION__, func_get_args());
3838
}

src/Testing/Resources/VectorStoresFilesTestResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function create(string $vectorStoreId, array $parameters): VectorStoreFil
3333
return $this->record(__FUNCTION__, func_get_args());
3434
}
3535

36-
public function list(string $vectorStoreId): VectorStoreFileListResponse
36+
public function list(string $vectorStoreId, array $parameters = []): VectorStoreFileListResponse
3737
{
3838
return $this->record(__FUNCTION__, func_get_args());
3939
}

src/Testing/Resources/VectorStoresTestResource.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,17 @@ public function resource(): string
2020
return VectorStores::class;
2121
}
2222

23-
public function modify(string $vectorStore, array $parameters): VectorStoreResponse
23+
public function modify(string $vectorStoreId, array $parameters): VectorStoreResponse
2424
{
2525
return $this->record(__FUNCTION__, func_get_args());
2626
}
2727

28-
public function retrieve(string $vectorStore): VectorStoreResponse
28+
public function retrieve(string $vectorStoreId): VectorStoreResponse
2929
{
3030
return $this->record(__FUNCTION__, func_get_args());
3131
}
3232

33-
public function delete(string $vectorStore): VectorStoreDeleteResponse
33+
public function delete(string $vectorStoreId): VectorStoreDeleteResponse
3434
{
3535
return $this->record(__FUNCTION__, func_get_args());
3636
}
@@ -40,7 +40,7 @@ public function create(array $parameters): VectorStoreResponse
4040
return $this->record(__FUNCTION__, func_get_args());
4141
}
4242

43-
public function list(): VectorStoreListResponse
43+
public function list(array $parameters = []): VectorStoreListResponse
4444
{
4545
return $this->record(__FUNCTION__, func_get_args());
4646
}

0 commit comments

Comments
 (0)