forked from phoenix/litellm-mirror
fix yield + version number
This commit is contained in:
parent
fcecb30d29
commit
406290b9e4
3 changed files with 139 additions and 6 deletions
|
@ -766,11 +766,9 @@ async def get_ollama_response_stream(api_base="http://localhost:11434", model="l
|
|||
if chunk.strip() != "":
|
||||
j = json.loads(chunk)
|
||||
if "response" in j:
|
||||
print(j["response"])
|
||||
yield {
|
||||
"role": "assistant",
|
||||
"content": j["response"]
|
||||
}
|
||||
completion_obj ={ "role": "assistant", "content": ""}
|
||||
completion_obj["content"] = j["response"]
|
||||
yield {"choices": [{"delta": completion_obj}]}
|
||||
# self.responses.append(j["response"])
|
||||
# yield "blank"
|
||||
except Exception as e:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue