Open
Description
Description
I am using llama3.1 model using @ai-sdk/openai
package.
I get this error
{"object":"error","message":"[{'type': 'value_error', 'loc': ('body',), 'msg': 'Value error, Currently only named tools are supported.',.........
when using 'toolchoice': 'auto' in streamUI or not set it at all.
On reading further I found out that llama doesnt support "tool_choice": "auto" parameter in its API. If its set to null it automatically gets converted to auto.
https://github.com/vercel/ai/blob/f7a94535f1d8b8a6f4179d7f5cd762389ef6de4b/packages/core/core/prompt/prepare-tools-and-tool-choice.ts#L37C21-L37C25
Solution: - support null as parameter which doesnt send tool-choice
to Llama or some other models API
Code example
{"object":"error","message":"[{'type': 'value_error', 'loc': ('body',), 'msg': 'Value error, Currently only named tools are supported.',
```
### Additional context
_No response_