[@azure-rest/ai-inference] missing exported/re-exported types
sinedied opened this issue · comments
- 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
Some types are missing or not (re-)exported, like the ErrorModeltype
for the client response or parsed JSON response (Chat completion delta) from the SSE stream. In strongly typed environments that's an issue, again also with linters.
This means that you either have to write your own types (risking breaking changes/builds with updates) and cannot use explicit typing (sometimes inferred types are not enough).
Expected behavior
All used types in the library should be re-exported (like ErrorModeltype
), and even if they're not returned/used directly by the client the type for the response objects should be provided, like for the Chat completion delta.
@sinedied The ErrorModel type you're referring to is this one, correct?
Would it be possible to import that type in your application code from "@azure-rest/core-client"?
@jeremymeng Suggestions welcome here.
@glharper The issue is that @azure-rest/core-client is a transitive dependency, importing code from transitive deps is considered a bad practice, and may not even working depending of the package manager used.
Re-exporting the type here would be best for DX, as @jeremymeng mentioned.