openai-php / openai-php/client
[Bug]: Undefined array key "chunking_strategy"
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 5.8k
- Forks
- 679
- Avg merge
- 19m
- Merged PRs (30d)
- 2
Description
Description
When using this library with Azure Open AI and attempting to list the Vector Store Files for a particular Vector Store, the following exception is thrown: Undefined array key "chunking_strategy"
This is due to the expectation in the src/Responses/VectorStores/Files/VectorStoreFileResponse.php from() method that the "chunking_strategy" key will exist.
I'd be happy to open a PR to resolve this if I have some upcoming availability, but also want to ensure that support for Azure Open AI is desired by the maintainers before doing so. It does appear that Azure / OpenAI continue to diverge a bit in their respective APIs, resulting in some maintenance nightmares.
Steps To Reproduce
- Use this library with Azure Open AI
- Try to list the Vector Store Files for a Vector Store:
$this->client->vectorStores()->files()->list(
vectorStoreId: $vectorStoreId,
);
OpenAI PHP Client Version
v0.10.1
PHP Version
8.2.20
Notes
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/Responses/VectorStores/Files/VectorStoreFileResponse.php, specifically the from() method, and reproduce the failure by listing files from an Azure OpenAI vector store. Confirm that the response can be handled when chunking_strategy is absent, with the listing completing without an undefined-key exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100