From b69a092f56c713ac9dcaf9dceb59c29faec2d315 Mon Sep 17 00:00:00 2001 From: corrm Date: Tue, 25 Jun 2024 12:40:07 +0300 Subject: [PATCH] Rename ollama prompt: - 'Function' word to 'FunctionName' - 'Tool Call' to `FunctionCall` - 'Tool Call Result' to 'FunctionCall Result' _I found that changes make some models better_ --- litellm/llms/prompt_templates/factory.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/litellm/llms/prompt_templates/factory.py b/litellm/llms/prompt_templates/factory.py index 109c5b8d8..7864d5ebc 100644 --- a/litellm/llms/prompt_templates/factory.py +++ b/litellm/llms/prompt_templates/factory.py @@ -181,9 +181,9 @@ def ollama_pt( for call in message["tool_calls"]: function_name = call["function"]["name"] arguments = json.loads(call["function"]["arguments"]) - prompt += f"### Tool Call ({call["id"]}):\nName: {function_name}\nArguments: {json.dumps(arguments)}\n\n" + prompt += f"### FunctionCall ({call["id"]}):\nFunctionName: {function_name}\nArguments: {json.dumps(arguments)}\n\n" elif "tool_call_id" in message: - prompt += f"### Tool Call Result ({message["tool_call_id"]}):\n{message["content"]}\n\n" + prompt += f"### FunctionCall Result ({message["tool_call_id"]}):\n{message["content"]}\n\n" elif content: prompt += f"### {role.capitalize()}:\n{content}\n\n"