#Missing type definitions and schema issue with node Openai 3.2.1?

4 messages · Page 1 of 1 (latest)

hollow mesa
#

Hi everyone,

Updated to openai 3.2.1 and when trying to import the type definitions, seems like there are some issues:

  1. If you pass an array variable as messages to CreateChatCompletionRequest - it will complain about it not being an array, but inline declaration of an array object works fine
  2. Library seems to be missing an equivalent of CreateCompletionResponse - Assume this should be CreateChatCompletionResponse ? But doesn't seem to exist, therefore it's missing type safety here as the "choices" object doesn't map correctly
  3. Also in the API docs, it says that the /chat/completions endpoint should return a choices object with a messages key, but infact it is returning a delta key instead?
odd quartz
# hollow mesa Hi everyone, Updated to openai 3.2.1 and when trying to import the type definit...

1&2: Looking at the repo https://github.com/openai/openai-node I'm seeing those type defs there. https://github.com/openai/openai-node/blob/master/dist/api.d.ts#L272 messages being an array of ChatCompletionRequestMessage and https://github.com/openai/openai-node/blob/master/dist/api.d.ts#L345 having CreateChatCompletionResponse.
3: You should only be getting a delta key if you streaming is true. Delta not being documented is a reported issue on the repo, they didn't actually document streaming using delta anywhere :/

hollow mesa
odd quartz
#

ah yea if it's not exported maybe make an issue on the repo about it since I'd think it should be? They really just forgot about mentioning delta anywhere dalle_tired