feat: switch xai provider to responses API#18175
feat: switch xai provider to responses API#18175Jaaneek wants to merge 1 commit intoanomalyco:devfrom
Conversation
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
| seenToolCalls.add(part.call_id); | ||
| controller.enqueue({ | ||
| type: "tool-input-start", | ||
| \ No newline at end of file |
There was a problem hiding this comment.
ai-sdk/xai responses API only work with the latest versions, those patches align the functionality to the latest version
Ideally we should just bump ai-sdk to v6
There was a problem hiding this comment.
Yeah im planning on doing that in next few days (bumping sdk)
Currently blocked by gitlab provider
There was a problem hiding this comment.
Should we merge this anyway so there is an instant improvement? Im happy to help with the migration if needed
| for (const modelID of Object.keys(provider.models)) { | ||
| if (modelID.includes("multi-agent")) delete provider.models[modelID] | ||
| } |
There was a problem hiding this comment.
not sure if thats the best way to do it but works. We need to hide multi agent until it supports client side tools
There was a problem hiding this comment.
There is an easier way, we just change this to false:
https://github.com/anomalyco/models.dev/blob/123054ae0c1b46cedb536aa0507d94dea48db244/providers/xai/models/grok-4.20-multi-agent-beta-latest.toml#L9
There was a problem hiding this comment.
I updated models.dev, should sync everywhere soon
There was a problem hiding this comment.
thank you, I will remove it from here
I will also open PR to rename the models to drop the "beta" from the name. Unless you can quickly do it.
615bc30 to
2b8a267
Compare
2b8a267 to
80d2d37
Compare
Issue for this PR
Closes #18179 #3890
Type of change
What does this PR do?
Switches xAI provider from completions API to responses API. The reason for this change is to use 'reasoning.encrypted_content' with reasoning models. This should improve performance in long multi turn conversations.
How did you verify your code works?
I did a lot of manual testing also told agent to test the changes e2e. I tried reading files, writing code, opening images etc..
Screenshots / recordings
Checklist
If you do not follow this template your PR will be automatically rejected.