fix: guard missing vector store response description for Azure OpenAI compatibility#765
Merged
iBotPeaches merged 1 commit intoopenai-php:mainfrom Apr 29, 2026
Conversation
…bility Azure OpenAI's vector-store endpoint does not yet return the `description` field that was added in v0.19.1, causing "Undefined array key description" errors. Default to null when the key is absent, consistent with how other optional fields are handled across the codebase.
iBotPeaches
approved these changes
Apr 29, 2026
Collaborator
|
thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What:
Description:
This package targets the OpenAI API, but the same SDK also works against Azure OpenAI, which exposes an OpenAI-compatible surface. For teams on Azure (often for compliance, data-residency, or enterprise-procurement reasons) it's nice to be able to stay on the same client as everyone else.
v0.19.1added a newdescriptionfield toVectorStoreResponseand reads it unconditionally inVectorStoreResponse::from(). Azure OpenAI's vector-store endpoint does not (yet) return that field, so calls against Azure now fail with:This guards the read with
?? null, matching the pattern already used for other optional fields across the codebase (e.g.CreateResponse,CreateStreamedResponse,CreateResponseMessage). The constructor parameter is already?string, so behavior against OpenAI is unchanged, but Azure users no longer have to pin to<0.19.1while waiting for parity on Microsoft's side.A small, defensive change that costs nothing for OpenAI users and unblocks the Azure ones.