Skip to content

Commit

Permalink
Fix bug when using conversation with async call
Browse files Browse the repository at this point in the history
Refs: simonw/llm#674
---------

Co-authored-by: Sukhbinder Singh <sukhbindersingh@gmail.com>
  • Loading branch information
sukhbinder and Sukhbinder Singh authored Dec 19, 2024
1 parent a45859c commit 6b4a31a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llm_gemini.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def build_messages(self, prompt, conversation):
if response.prompt.prompt:
parts.append({"text": response.prompt.prompt})
messages.append({"role": "user", "parts": parts})
messages.append({"role": "model", "parts": [{"text": response.text()}]})
messages.append({"role": "model", "parts": [{"text": response.text_or_raise()}]})

parts = []
if prompt.prompt:
Expand Down Expand Up @@ -335,4 +335,4 @@ def embed_batch(self, items):
)

response.raise_for_status()
return [item["values"] for item in response.json()["embeddings"]]
return [item["values"] for item in response.json()["embeddings"]]

0 comments on commit 6b4a31a

Please # to comment.