[GH-ISSUE #1759] Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'r.choices[0].delta') #83367

Closed
opened 2026-05-15 08:20:05 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @mandasaka on GitHub (Apr 26, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/1759

Bug Report

Description

Hello,
I noticed that the newly added src/lib/apis/streaming
/index.ts script in version v0.1.121 fails to handle responses where the 'choices' field lacks a 'delta', with these responses coming from Azure OpenAI.

The first response from completions:

data: {"choices":[],"created":0,"id":"","model":"","object":"","prompt_filter_results":[{"prompt_index":0,"content_filter_results":{"hate":{"filtered":false,"severity":"safe"},"self_harm":{"filtered":false,"severity":"safe"},"sexual":{"filtered":false,"severity":"safe"},"violence":{"filtered":false,"severity":"safe"}}}]}

Thank you and looking forward to your response.

Originally created by @mandasaka on GitHub (Apr 26, 2024). Original GitHub issue: https://github.com/open-webui/open-webui/issues/1759 # Bug Report ## Description Hello, I noticed that the newly added [src](https://github.com/open-webui/open-webui/tree/main/src)/[lib](https://github.com/open-webui/open-webui/tree/main/src/lib)/[apis](https://github.com/open-webui/open-webui/tree/main/src/lib/apis)/[streaming](https://github.com/open-webui/open-webui/tree/main/src/lib/apis/streaming) /index.ts script in version v0.1.121 fails to handle responses where the 'choices' field lacks a 'delta', with these responses coming from Azure OpenAI. The first response from completions: data: {"choices":[],"created":0,"id":"","model":"","object":"","prompt_filter_results":[{"prompt_index":0,"content_filter_results":{"hate":{"filtered":false,"severity":"safe"},"self_harm":{"filtered":false,"severity":"safe"},"sexual":{"filtered":false,"severity":"safe"},"violence":{"filtered":false,"severity":"safe"}}}]} Thank you and looking forward to your response.
Author
Owner

@tjbck commented on GitHub (Apr 26, 2024):

@cheahjs

<!-- gh-comment-id:2079764674 --> @tjbck commented on GitHub (Apr 26, 2024): @cheahjs
Author
Owner

@tjbck commented on GitHub (Apr 26, 2024):

Should be fixed on our dev branch now, let me know if the issue persists!

<!-- gh-comment-id:2079868436 --> @tjbck commented on GitHub (Apr 26, 2024): Should be fixed on our dev branch now, let me know if the issue persists!
Author
Owner

@mandasaka commented on GitHub (Apr 28, 2024):

It’s ok now, thx

<!-- gh-comment-id:2081478633 --> @mandasaka commented on GitHub (Apr 28, 2024): It’s ok now, thx
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#83367