mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
fix issue with parsing assistant messages (#15320)
* Update factory.py * reinclude the test cases * fixed test --------- Co-authored-by: Weijie <weijie-tan3@github.com>
This commit is contained in:
parent
13703f289b
commit
0b6b69cd5b
1 changed files with 1 additions and 2 deletions
|
|
@ -232,7 +232,6 @@ def ollama_pt(
|
|||
## MERGE CONSECUTIVE ASSISTANT CONTENT ##
|
||||
while msg_i < len(messages) and messages[msg_i]["role"] == "assistant":
|
||||
assistant_content_str += convert_content_list_to_str(messages[msg_i])
|
||||
msg_i += 1
|
||||
|
||||
tool_calls = messages[msg_i].get("tool_calls")
|
||||
ollama_tool_calls = []
|
||||
|
|
@ -258,7 +257,7 @@ def ollama_pt(
|
|||
f"Tool Calls: {json.dumps(ollama_tool_calls, indent=2)}"
|
||||
)
|
||||
|
||||
msg_i += 1
|
||||
msg_i += 1
|
||||
|
||||
if assistant_content_str:
|
||||
prompt += f"### Assistant:\n{assistant_content_str}\n\n"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue