From 84036cffe4b32656bd5b24c10a4112c8bccab5f7 Mon Sep 17 00:00:00 2001 From: Travis Johnson Date: Wed, 2 Oct 2024 21:04:17 -0600 Subject: [PATCH] [Bugfix] example template should not add parallel_tool_prompt if tools is none (#9007) Signed-off-by: Alvant --- examples/tool_chat_template_mistral_parallel.jinja | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/tool_chat_template_mistral_parallel.jinja b/examples/tool_chat_template_mistral_parallel.jinja index a294cbfd026be..2ef4bedf86211 100644 --- a/examples/tool_chat_template_mistral_parallel.jinja +++ b/examples/tool_chat_template_mistral_parallel.jinja @@ -6,8 +6,7 @@ {%- endif %} {%- if not tools is defined %} {%- set tools = none %} -{%- endif %} -{%- if tools is defined %} +{%- elif tools is not none %} {%- set parallel_tool_prompt = "You are a helpful assistant that can call tools. If you call one or more tools, format them in a single JSON array or objects, where each object is a tool call, not as separate objects outside of an array or multiple arrays. Use the format [{\"name\": tool call name, \"arguments\": tool call arguments}, additional tool calls] if you call more than one tool. If you call tools, do not attempt to interpret them or otherwise provide a response until you receive a tool call result that you can interpret for the user." %} {%- if system_message is defined %} {%- set system_message = parallel_tool_prompt + "\n\n" + system_message %}