Skip to content

Conversation

@syeddhasnainn
Copy link
Contributor

Background

streamText was throwing a validation error when using the x_search tool because some event types returned by xAI were missing from the xaiResponsesChunkSchema

Summary

I updated the chunkSchema with the missing types and also added a test in packages/xai/src/responses/xai-responses-language-model.test.ts

Manual Verification

I tested it by running the xai-x-search-video-understanding example

Checklist

  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • I have reviewed this pull request (self-review)

Related Issues

fixes #10628

@syeddhasnainn syeddhasnainn changed the title fix(provider/xai): streamText delta validation error with xAI x_search tool (#10628) fix(provider/xai): streamText delta validation error with xAI x_search tool Dec 1, 2025
@syjcnss
Copy link

syjcnss commented Dec 2, 2025

@syeddhasnainn This fix missed the delta field in custom_tool_call_input.delta and the input filed in custom_tool_call_input.done. My PR addresses the same problem #10715 . You may want to add them and I'm closing my PR.

@syeddhasnainn
Copy link
Contributor Author

Can you please recheck? I can see both the events.

@syjcnss
Copy link

syjcnss commented Dec 2, 2025

Rechecked. I can confirm the event stream works without defining the delta and input fields. Nice work.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

streamText fails with response.custom_tool_call_input.delta validation error when using xAI x_search tool Body

2 participants