[Bug]: api/completion endpoint returns 200 but body contains error
Is there an existing issue for the same bug?
- [X] I have checked the existing issues.
Branch name
main
Commit ID
3b7b6240c3adb967c5fe9e98ed73c05cd60ecd46
Other environment information
No response
Actual behavior
API returns 200/OK with object:
data:{"retcode": 500, "retmsg": "'function' object is not subscriptable", "data": {"answer": "ERROR: 'function' object is not subscriptable", "reference": []}}
data:{"retcode": 0, "retmsg": "", "data": true}
Expected behavior
No response
Steps to reproduce
POST object with "conversation_id" and "messages" to <base_url>/v1/api/completion
Receive 200/OK and error
Additional information
No response
Could you specify that errro. There's not any error message here.
Screenshots attached.
What is the version of the docker image and the code? I suggest you to use dev version of image and pull the latest code.
I have tried both latest and dev. They all have the same issue. All the other endpoints, including the ones that were not working before are functioning normally, i.e. list_chunks. It is just completion that shows this error.
Current env:
I have worked around this issue but the bug remains. The issue is with the 'stream' option which if set to True will cause the retval 500. For now I am able to get completion results by specifying "stream": false.