Skip to content

[JS] Missing isUnexpected Overload #2013

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
minhanh-phan opened this issue Sep 11, 2023 · 4 comments · Fixed by #2097
Closed

[JS] Missing isUnexpected Overload #2013

minhanh-phan opened this issue Sep 11, 2023 · 4 comments · Fixed by #2097
Assignees

Comments

@minhanh-phan
Copy link
Member

The generation isUnexpected method is missing multiple overloads. There are 5 different audio formats json, verbose_json, vrt, stt, text for translation and transcription task, but only 1 format json` is generated.

The generated isUnexpected method for audio tasks is here.

export function isUnexpected(
  response:
    | GetAudioTranscriptionSimpleJson200Response
    | GetAudioTranscriptionSimpleJsonDefaultResponse
): response is GetAudioTranscriptionSimpleJsonDefaultResponse;
export function isUnexpected(
  response:
    | GetAudioTranslationSimpleJson200Response
    | GetAudioTranslationSimpleJsonDefaultResponse
): response is GetAudioTranslationSimpleJsonDefaultResponse;

The TypeSpec definition of these 5 models for translation task is here

Expected: An overload for each of the interface

Reproduce:

  • Use the latest commit fb4f558b15075826656a3061d332d1a198352dd4 to regenerate for OpenAI package
@MaryGao
Copy link
Member

MaryGao commented Oct 11, 2023

Thanks for reporting this! I think we need to improve our isUnexpected to accept all overloading types.

@MaryGao MaryGao added the openai label Oct 11, 2023
@minhanh-phan
Copy link
Member Author

Hi @MaryGao, I want to check in on the progress of this issue. This is a blocker for OpenAI and would love to have a resolution soon! Thank you.

@MaryGao
Copy link
Member

MaryGao commented Nov 8, 2023

@minhanh-phan May I know if there is any build failure introduced by missing types? Jose is working on the fix and I'd like to know how to detect these issues in our testing.

@minhanh-phan
Copy link
Member Author

@MaryGao Yes, we were trying to generate with the latest commit 8f13627230772d90c8db09636e88b9a26dc73044 from this PR. The sources folder cannot be built because there are error types from missing the isUnexpected overload in the operations.ts file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants