openai-php / client

⚡️ OpenAI PHP is a supercharged community-maintained PHP API client that allows you to interact with OpenAI API.
MIT License
4.56k stars 465 forks source link

[Bug]: Undefined array key "chunking_strategy" #425

Open dgoetzit opened 3 weeks ago

dgoetzit commented 3 weeks ago

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

  1. Use this library with Azure Open AI
  2. 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