⚡️ OpenAI PHP is a supercharged community-maintained PHP API client that allows you to interact with OpenAI API.
4.56k
stars
465
forks
source link
[Bug]: \OpenAI\Resources\VectorStoresFileBatches::cancel should POST, missing `cancel` path component #433
Open
jhariani opened 1 week ago
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