ajndkr / lanarky

The web framework for building LLM microservices
https://lanarky.ajndkr.com/
MIT License
976 stars 74 forks source link

bug: openai error: list index out of range #198

Open pansusu opened 5 months ago

pansusu commented 5 months ago

Scenario

ChatCompletionChunk(id='chatcmpl-9RcbQpfZm1cThi6f3lw1rjLEbmxcr', choices=[]

the openai 'choices' of chunk maybe empty.

Actual result

image

You need to add a check for an empty array.

Expected result

-

Acceptance criteria

Contribute

ajndkr commented 5 months ago

@pansusu thanks for reporting the bug! if you want to contribute, please feel free to open a pull request. I will review and make a new patch release.