forked from phoenix/litellm-mirror
fix(utils.py): handle ollama yielding a dict
This commit is contained in:
parent
eb2d13e2fb
commit
f1270a7c78
1 changed files with 4 additions and 1 deletions
|
@ -5811,7 +5811,10 @@ class CustomStreamWrapper:
|
|||
|
||||
def handle_ollama_stream(self, chunk):
|
||||
try:
|
||||
json_chunk = json.loads(chunk)
|
||||
if isinstance(chunk, dict):
|
||||
json_chunk = chunk
|
||||
else:
|
||||
json_chunk = json.loads(chunk)
|
||||
if "error" in json_chunk:
|
||||
raise Exception(f"Ollama Error - {json_chunk}")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue