lanarky icon indicating copy to clipboard operation
lanarky copied to clipboard

bug: openai error: list index out of range

Open pansusu opened this issue 1 year ago • 1 comments

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

  • [X] Yes, I can fix this bug and open a PR

pansusu avatar May 22 '24 09:05 pansusu

@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.

ajndkr avatar May 22 '24 10:05 ajndkr