Skip to content
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

[JS] Mismatch Type for 'file' Property #2007

Closed
minhanh-phan opened this issue Sep 7, 2023 · 5 comments · Fixed by #2006
Closed

[JS] Mismatch Type for 'file' Property #2007

minhanh-phan opened this issue Sep 7, 2023 · 5 comments · Fixed by #2006
Assignees
Labels

Comments

@minhanh-phan
Copy link

minhanh-phan commented Sep 7, 2023

The DPG generation for the latest Whisper feature of @azure/openai is having mismatch type between "string" and "bytes". The type of the file property for transcription interface is string. This cause a build error because the type in the parameter is Uint8Array in all the getAudioTranscriptions here.

An example of the function signature is here

export function _getAudioTranscriptionSimpleJsonSend(
  context: Client,
  file: Uint8Array,
  deploymentId: string,
  options: GetAudioTranscriptionSimpleJsonOptions = { requestOptions: {} }

But the type definition is string here

export interface AudioTranscriptionOptionsSimpleJson {
  /** The audio file object to transcribe. */
  file: string;

Expectation: We expected the type of the file is Uint8Array. The definition in the TypeSpec file is bytes here.

Reproduce:

  • Use the latest commit for the TypeSpec file d33d47dc85ef1f2c29c3dd278ded3650df9e49d7
@qiaozha
Copy link
Member

qiaozha commented Sep 8, 2023

which version of typespec-ts emitter are you using ? I feel like this should have been resolved.

@qiaozha
Copy link
Member

qiaozha commented Sep 8, 2023

oh no, you are right, this is the serialization, it should be able to resolve after #2006 get merged.

@qiaozha qiaozha self-assigned this Sep 8, 2023
@minhanh-phan
Copy link
Author

Thank you very much for the quick support. We're using the dev version for the emitter.

@qiaozha
Copy link
Member

qiaozha commented Sep 11, 2023

@minhanh-phan Could you try the latest emitter to see if this issue has been resolved ? Feel free to reopen if it isn't.

@minhanh-phan
Copy link
Author

@qiaozha Thank you very much. The issue has been resolved!

@qiaozha qiaozha added the HRLC label Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants