From fc73c57e8bf657134c8d574e52989f295694547c Mon Sep 17 00:00:00 2001 From: python273 Date: Mon, 10 Feb 2025 19:02:36 +0400 Subject: [PATCH 1/2] Fix function_calling.sh example --- samples/rest/function_calling.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/samples/rest/function_calling.sh b/samples/rest/function_calling.sh index f88641e81..288564d2f 100644 --- a/samples/rest/function_calling.sh +++ b/samples/rest/function_calling.sh @@ -8,8 +8,7 @@ cat > tools.json << EOF "function_declarations": [ { "name": "enable_lights", - "description": "Turn on the lighting system.", - "parameters": { "type": "object" } + "description": "Turn on the lighting system." }, { "name": "set_light_color", @@ -29,8 +28,7 @@ cat > tools.json << EOF }, { "name": "stop_lights", - "description": "Turn off the lighting system.", - "parameters": { "type": "object" } + "description": "Turn off the lighting system." } ] } @@ -45,10 +43,10 @@ curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro-lat "text": "You are a helpful lighting system bot. You can turn lights on and off, and you can set the color. Do not perform any other tasks." } }, - "tools": ['$(source "$tools")'], + "tools": ['$(cat tools.json)'], "tool_config": { - "function_calling_config": {"mode": "none"} + "function_calling_config": {"mode": "auto"} }, "contents": { From bb5f10614ebd2cb6b4ae60bd91e5cdacb144d487 Mon Sep 17 00:00:00 2001 From: Mark Daoust Date: Thu, 20 Feb 2025 10:56:33 -0800 Subject: [PATCH 2/2] Update function_calling.sh --- samples/rest/function_calling.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/rest/function_calling.sh b/samples/rest/function_calling.sh index 288564d2f..c6479811a 100644 --- a/samples/rest/function_calling.sh +++ b/samples/rest/function_calling.sh @@ -52,7 +52,7 @@ curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro-lat "contents": { "role": "user", "parts": { - "text": "What can you do?" + "text": "Turn on the lights please." } } }