-
Notifications
You must be signed in to change notification settings - Fork 718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Azure OpenAI always returns: n.choices[0] is undefined
error
#698
Comments
Maybe the reason why is that the new API version responds empty {
"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"
}
}
}
]
} |
Okay, that's my fault 😓 |
PeterDaveHello
added a commit
to PeterDaveHello/chatGPTBox
that referenced
this issue
May 12, 2024
This commit refines the error handling for the Azure OpenAI API integration to address the 'n.choices[0] is undefined' error by ensuring 'data.choices' and 'data.choices[0]' are properly checked before access. This update is necessary due to the behavior changes introduced in the API version update (josStorer#684), which can result in empty 'choices' arrays. Fix josStorer#698.
PeterDaveHello
added a commit
to PeterDaveHello/chatGPTBox
that referenced
this issue
May 12, 2024
This commit refines the error handling for the Azure OpenAI API integration to address the 'n.choices[0] is undefined' error by ensuring 'data.choices' and 'data.choices[0]' are properly checked before access. This update is necessary due to the behavior changes introduced in the API version update (josStorer#684), which can result in empty 'choices' arrays. Fix josStorer#698.
josStorer
pushed a commit
that referenced
this issue
May 12, 2024
This commit refines the error handling for the Azure OpenAI API integration to address the 'n.choices[0] is undefined' error by ensuring 'data.choices' and 'data.choices[0]' are properly checked before access. This update is necessary due to the behavior changes introduced in the API version update (#684), which can result in empty 'choices' arrays. Fix #698.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
问题描述
Azure OpenAI always returns:
n.choices[0] is undefined
error as shown in the screenshot below.To Reproduce
如何复现
Steps to reproduce the behavior:
Use
ChatGPT (Azure)
and send any prompt.Expected behavior
期望行为
Response as normal.
Screenshots
截图说明
Please complete the following information):
请补全以下内容
Additional context
其他
I checked recent changes for Azure OpenAI. This PR may be related: #684
The text was updated successfully, but these errors were encountered: