Skip to content

Conversation

@dnnp2011
Copy link
Contributor

@dnnp2011 dnnp2011 commented Sep 24, 2025

What:

  • Bug Fix
  • New Feature

Description:

xAI Responses API does not return certain attributes. The Responses/Responses/CreateResponse class already allows these fields to be null.

  • Added null fallbacks to instructions, and truncation attributes to avoid errors when handling xAI Responses API response (e.g. grok-4)

See xAI Docs

xAI Responses API does not return certain attributes. The `Responses/Responses/CreateResponse` class already allows these fields to be null.

- Added null fallbacks to `instructions`, `outputText`, and `truncation` attributes
Copy link
Collaborator

@iBotPeaches iBotPeaches left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand the instructions and truncation one, but outputText is just an SDK property that pulls text from output and that has to be in xAI as its the entire point of response api.

@dnnp2011
Copy link
Contributor Author

Yeah I noticed that after I opened it last night, I'll fix it today to resolve the failing tests

`$output` should always be defined, so no need to do null checks.
@iBotPeaches iBotPeaches merged commit 4ee51f1 into openai-php:main Sep 24, 2025
12 checks passed
@iBotPeaches iBotPeaches added this to the v0.17.0 milestone Sep 24, 2025
@iBotPeaches
Copy link
Collaborator

thanks for quick fixes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants