ITADN

OpenAI always returns choices as empty array on every input.

#310Openshoumyadeeep 创建于 2025-07-29
S
shoumyadeeepcommented
```response {"choices":[],"created":0,"id":"","model":"","object":"","prompt_filter_results":[{"prompt_index":0,"content_filter_results":{"hate":{"filtered":false,"severity":"safe"},"jailbreak":{"filtered":false,"detected":false},"self_harm":{"filtered":false,"severity":"safe"},"sexual":{"filtered":false,"severity":"safe"},"violence":{"filtered":false,"severity":"safe"}}}]} lead to exception of list index out of range response {"choices":[],"created":0,"id":"","model":"","object":"","prompt_filter_results":[{"prompt_index":0,"content_filter_results":{"hate":{"filtered":false,"severity":"safe"},"jailbreak":{"filtered":false,"detected":false},"self_harm":{"filtered":false,"severity":"safe"},"sexual":{"filtered":false,"severity":"safe"},"violence":{"filtered":false,"severity":"safe"}}}]} lead to exception of list index out of range Traceback (most recent call last): File "/home/frappe/mindsearch/venv/lib/python3.10/site-packages/lagent/llms/openai.py", line 741, in streaming choice = response['choices'][0] IndexError: list index out of range The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home/frappe/mindsearch/venv/lib/python3.10/site-packages/lagent/llms/openai.py", line 791, in _stream_chat async for msg in streaming(raw_response): File "/home/frappe/mindsearch/venv/lib/python3.10/site-packages/lagent/llms/openai.py", line 748, in streaming raise Exception(msg) from exc Exception: response {"choices":[],"created":0,"id":"","model":"","object":"","prompt_filter_results":[{"prompt_index":0,"content_filter_results":{"hate":{"filtered":false,"severity":"safe"},"jailbreak":{"filtered":false,"detected":false},"self_harm":{"filtered":false,"severity":"safe"},"sexual":{"filtered":false,"severity":"safe"},"violence":{"filtered":false,"severity":"safe"}}}]} lead to exception of list index out of range```
0 条评论