Skip to content

[@azure-rest/ai-inference] incorrect type when using streaming #33334

Open
@sinedied

Description

@sinedied
  • 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

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.

Metadata

Metadata

Assignees

Labels

Azure.CoreClientThis issue points to a problem in the data-plane of the library.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions