We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cancel
If you attempt to use \OpenAI\Resources\VectorStoresFileBatches::cancel to cancel a vector store file batch, the OAI API will return this error:
\OpenAI\Resources\VectorStoresFileBatches::cancel
Invalid method for URL (DELETE /v1/vector_stores/vs_id/file_batches/vsfb_id)
This is because the payload is constructed with this HTTP method and URL pattern:
$payload = Payload::delete("vector_stores/$vectorStoreId/file_batches", $fileBatchId);
Per the OAI cancel batch documentation it should POST to cancel the batch, and construct the URL with this pattern:
https://api.openai.com/v1/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel
Solution: Change this to use the Payload's cancel helper method:
$payload = Payload::cancel("vector_stores/$vectorStoreId/file_batches", $fileBatchId);
$file = app(\OpenAI\Client::class)->files()->upload($data);
$batch = app(\OpenAI\Client::class)->vectorStores()->batches()->create($vectorStoreId, ['file_ids' => [$file->id]);
app((\OpenAI\Client::class)->vectorStores()->batches()->cancel($vectorStoreId, $batch->id)
v0.10.1
8.2.17
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
If you attempt to use
\OpenAI\Resources\VectorStoresFileBatches::cancel
to cancel a vector store file batch, the OAI API will return this error:This is because the payload is constructed with this HTTP method and URL pattern:
Per the OAI cancel batch documentation it should POST to cancel the batch, and construct the URL with this pattern:
Solution: Change this to use the Payload's cancel helper method:
Steps To Reproduce
$file = app(\OpenAI\Client::class)->files()->upload($data);
$batch = app(\OpenAI\Client::class)->vectorStores()->batches()->create($vectorStoreId, ['file_ids' => [$file->id]);
app((\OpenAI\Client::class)->vectorStores()->batches()->cancel($vectorStoreId, $batch->id)
OpenAI PHP Client Version
v0.10.1
PHP Version
8.2.17
Notes
No response
The text was updated successfully, but these errors were encountered: