Skip to content

Commit

Permalink
make gemini robust
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinHuSh committed Oct 25, 2024
1 parent 648f8e8 commit f49382a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rag/llm/chat_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -780,10 +780,11 @@ def chat_streamly(self, system, history, gen_conf):
ans += resp.text
yield ans

yield response._chunks[-1].usage_metadata.total_token_count
except Exception as e:
yield ans + "\n**ERROR**: " + str(e)

yield response._chunks[-1].usage_metadata.total_token_count
yield 0


class GroqChat:
Expand Down

0 comments on commit f49382a

Please sign in to comment.