Confirm this is a Node library issue and not an underlying OpenAI API issue
Describe the bug
When streaming chat completions using client.chat.completions.create with AzureOpenAI client and reading with ChatCompletionStreamingRunner.fromReadableStream on the client, the following error occurs:
OpenAIError: Cannot read properties of undefined (reading 'content')
Cause:
The error seems to be caused by choice.delta being undefined at some point during the streaming process, usually at the end of the stream.
Questions:
- Is this a known issue?
- Will this library support streaming from Azure, given potential differences in response structure?
To Reproduce
- Initialize an
AzureOpenAI client
- Using
client.chat.completions.create stream a response to the client (a web app)
- Stream the response using
ChatCompletionStreamingRunner.fromReadableStream on the client
- Observe the error
Code snippets
No response
OS
macOS
Node version
Node v20.14.0
Library version
openai 4.56.0
Confirm this is a Node library issue and not an underlying OpenAI API issue
Describe the bug
When streaming chat completions using
client.chat.completions.createwithAzureOpenAIclient and reading withChatCompletionStreamingRunner.fromReadableStreamon the client, the following error occurs:Cause:
The error seems to be caused by
choice.deltabeing undefined at some point during the streaming process, usually at the end of the stream.Questions:
To Reproduce
AzureOpenAIclientclient.chat.completions.createstream a response to the client (a web app)ChatCompletionStreamingRunner.fromReadableStreamon the clientCode snippets
No response
OS
macOS
Node version
Node v20.14.0
Library version
openai 4.56.0