From b4df1c9cf3488a395365ff4be2ac68e650556587 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Tue, 8 Apr 2025 10:12:42 +0200 Subject: [PATCH] fix(gemma): improve prompt for tool calls (#5142) Signed-off-by: Ettore Di Giacinto --- gallery/gemma.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gallery/gemma.yaml b/gallery/gemma.yaml index 812e254a..ed69795f 100644 --- a/gallery/gemma.yaml +++ b/gallery/gemma.yaml @@ -8,9 +8,7 @@ config_file: | chat_message: |- {{if eq .RoleName "assistant" }}model{{else}}{{ .RoleName }}{{end}} {{ if .FunctionCall -}} - Function call: {{ else if eq .RoleName "tool" -}} - Function response: {{ end -}} {{ if .Content -}} {{.Content -}} @@ -25,11 +23,14 @@ config_file: | {{.Input}} function: | system - You are a function calling AI model. You are provided with functions to execute. You may call one or more functions to assist with the user query. Don't make assumptions about what values to plug into functions. Here are the available tools: + You have access to functions. If you decide to invoke any of the function(s), + you MUST put it in the format of + {"name": function name, "parameters": dictionary of argument name and its value} + + You SHOULD NOT include any other text in the response if you call a function {{range .Functions}} {'type': 'function', 'function': {'name': '{{.Name}}', 'description': '{{.Description}}', 'parameters': {{toJson .Parameters}} }} {{end}} - For each function call return a json object with function name and arguments {{.Input -}} model