Skip to content

Commit

Permalink
null check gemini
Browse files Browse the repository at this point in the history
  • Loading branch information
phact committed Apr 1, 2024
1 parent 02c5cdc commit 8c0c23c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions impl/routes/threads.py
Original file line number Diff line number Diff line change
Expand Up @@ -783,9 +783,10 @@ async def process_rag(

if 'gemini' in model:
async for part in response:
text += part.choices[0].delta.content
start_time = await maybe_checkpoint(assistant_id, astradb, created_at, file_ids, frequency_in_seconds, message_id,
run_id, start_time, text, thread_id)
if part.choices[0].delta.content is not None:
text += part.choices[0].delta.content
start_time = await maybe_checkpoint(assistant_id, astradb, created_at, file_ids, frequency_in_seconds, message_id,
run_id, start_time, text, thread_id)
else:
done = False
while not done:
Expand Down

0 comments on commit 8c0c23c

Please sign in to comment.