mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-07 13:23:15 +00:00
If the list of choices in a chunk is empty, continue in openai response
This commit is contained in:
@@ -120,6 +120,8 @@ def llm_thread(g, messages, model_name, temperature, openai_api_key=None, api_ba
|
|||||||
)
|
)
|
||||||
|
|
||||||
for chunk in chat:
|
for chunk in chat:
|
||||||
|
if len(chunk.choices) == 0:
|
||||||
|
continue
|
||||||
delta_chunk = chunk.choices[0].delta
|
delta_chunk = chunk.choices[0].delta
|
||||||
if isinstance(delta_chunk, str):
|
if isinstance(delta_chunk, str):
|
||||||
g.send(delta_chunk)
|
g.send(delta_chunk)
|
||||||
|
|||||||
Reference in New Issue
Block a user