This commit is contained in:
isaac hershenson
2024-07-29 08:13:46 -07:00
parent eed9a19c2b
commit 1f364dcd81

View File

@@ -305,9 +305,7 @@ class OllamaLLM(BaseLLM):
if not isinstance(stream_resp, str):
chunk = GenerationChunk(
text=(
stream_resp["message"]["content"]
if "message" in stream_resp
else ""
stream_resp.get("response","")
),
generation_info=(
dict(stream_resp) if stream_resp.get("done") is True else None
@@ -331,9 +329,7 @@ class OllamaLLM(BaseLLM):
if not isinstance(stream_resp, str):
chunk = GenerationChunk(
text=(
stream_resp["message"]["content"]
if "message" in stream_resp
else ""
stream_resp.get("response","")
),
generation_info=(
dict(stream_resp) if stream_resp.get("done") is True else None