You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When streaming an agent response using the completions API with an Azure OpenAI endpoint, prompt annotations are returned from the model where the choices propery is []. The following code does not adequately handle a choices property that exists, but contains no elements:
if (!chunk.choices || !chunk.choices[0].delta)
continue;
This results in a Cannot read properties of undefined (reading 'delta') error.
Debug information
Agents SDK version: (e.g. v0.0.7)
Runtime environment (e.g. Node.js 22.16.0)
Repro steps
Use an Azure OpenAI endpoint with any prompt and the following set:
Describe the bug
When streaming an agent response using the completions API with an Azure OpenAI endpoint, prompt annotations are returned from the model where the choices propery is
[]
. The following code does not adequately handle a choices property that exists, but contains no elements:This results in a
Cannot read properties of undefined (reading 'delta')
error.Debug information
v0.0.7
)Node.js 22.16.0
)Repro steps
Use an Azure OpenAI endpoint with any prompt and the following set:
Expected behavior
At a minimum, the prompt annotations should be ignored and the streamed chat completion should resume.
The text was updated successfully, but these errors were encountered: