Skip to content

Commit

Permalink
Merge pull request #435 from TyperEJ/fix-vector-stores-file-batches-c…
Browse files Browse the repository at this point in the history
…ancel

fix: vector stores file batch cancel payload
  • Loading branch information
gehrisandro authored Aug 20, 2024
2 parents 127f96d + 6410d2b commit aa1f864
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Resources/VectorStoresFileBatches.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function listFiles(string $vectorStoreId, string $fileBatchId, array $par
*/
public function cancel(string $vectorStoreId, string $fileBatchId): VectorStoreFileBatchResponse
{
$payload = Payload::delete("vector_stores/$vectorStoreId/file_batches", $fileBatchId);
$payload = Payload::cancel("vector_stores/$vectorStoreId/file_batches", $fileBatchId);

/** @var Response<array{id: string, object: string, created_at: int, vector_store_id: string, status: string, file_counts: array{in_progress: int, completed: int, failed: int, cancelled: int, total: int}}> $response */
$response = $this->transporter->requestObject($payload);
Expand Down
2 changes: 1 addition & 1 deletion tests/Resources/VectorStoresFileBatches.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
});

test('cancel', function () {
$client = mockClient('DELETE', 'vector_stores/vs_abc123/file_batches/vsfb_abc123', [], Response::from(vectorStoreFileBatchResource(), metaHeaders()));
$client = mockClient('POST', 'vector_stores/vs_abc123/file_batches/vsfb_abc123/cancel', [], Response::from(vectorStoreFileBatchResource(), metaHeaders()));

$result = $client->vectorStores()->batches()->cancel('vs_abc123', 'vsfb_abc123');

Expand Down

0 comments on commit aa1f864

Please sign in to comment.