mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 21:19:12 +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:
|
||||
if len(chunk.choices) == 0:
|
||||
continue
|
||||
delta_chunk = chunk.choices[0].delta
|
||||
if isinstance(delta_chunk, str):
|
||||
g.send(delta_chunk)
|
||||
|
||||
Reference in New Issue
Block a user