openai-node icon indicating copy to clipboard operation
openai-node copied to clipboard

Fix Whisper non-json `response_format`

Open stefansundin opened this issue 1 year ago • 3 comments

  • [x] I understand that this repository is auto-generated and my pull request may not be merged

Changes being requested

I realized too late that these files are auto generated and I had already made the changes. Anyway, I think the PR describes the issue well. The output type is wrong for all response_format besides json. :(

Additional context & links

response_format: 'json' should return this type: https://platform.openai.com/docs/api-reference/audio/json-object

response_format: 'verbose_json' should return this type: https://platform.openai.com/docs/api-reference/audio/verbose-json-object

the other response formats just return string

stefansundin avatar Feb 17 '24 21:02 stefansundin

Ah, yeah sorry this is generated so we'd have to do this a different way. I actually think we may have also previously decided against making this change, but to be honest I can't recall why, and it certainly would be nice for these types to be accurate.

I'll leave the PR open for now, but chances are not high that we merge it.

In any case, I do appreciate your work here!

rattrayalex avatar Feb 19 '24 06:02 rattrayalex

If it is impossible to provide the correct types for various tooling reasons, then I think using any is a better option than a potentially incorrect type. Is that possible?

stefansundin avatar Mar 08 '24 17:03 stefansundin

Impossible is not the word, just not as quick as we'd like :)

rattrayalex avatar Mar 09 '24 03:03 rattrayalex