Open
Description
- Package Name: @azure-rest/ai-inference
- Package Version: 1.0.0-beta.5
- Operating system: MacOS
- nodejs
- version: v22.13.1
- browser
- name/version:
- typescript
- version: 5.8.2
- Is the bug related to documentation in
- README.md
- source code documentation
- SDK API docs on https://learn.microsoft.com
Describe the bug
Having to force-cast types like here:
const stream = responseStream.body as IncomingMessage;
when using streaming feels off, it would be best to fix either .asNodeStream()
or .createSseStream()
method to make them compatible and not force a fix onto users (again, strict linters rules can forbid casting at all).
I'm not sure when the limitation comes from, as the object are compatible with each other so it means that the type definition in one of these two method is wrong.
Expected behavior
Not having to force-cast the type of the stream body, types should be compatible out of the box.