Skip to content

Commit 45bd243

Browse files
Fix function_calling.sh example (#679)
* Fix function_calling.sh example * Update function_calling.sh --------- Co-authored-by: Mark Daoust <[email protected]>
1 parent f9053ae commit 45bd243

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

samples/rest/function_calling.sh

+5-7
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ cat > tools.json << EOF
88
"function_declarations": [
99
{
1010
"name": "enable_lights",
11-
"description": "Turn on the lighting system.",
12-
"parameters": { "type": "object" }
11+
"description": "Turn on the lighting system."
1312
},
1413
{
1514
"name": "set_light_color",
@@ -29,8 +28,7 @@ cat > tools.json << EOF
2928
},
3029
{
3130
"name": "stop_lights",
32-
"description": "Turn off the lighting system.",
33-
"parameters": { "type": "object" }
31+
"description": "Turn off the lighting system."
3432
}
3533
]
3634
}
@@ -45,16 +43,16 @@ curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro-lat
4543
"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."
4644
}
4745
},
48-
"tools": ['$(source "$tools")'],
46+
"tools": ['$(cat tools.json)'],
4947
5048
"tool_config": {
51-
"function_calling_config": {"mode": "none"}
49+
"function_calling_config": {"mode": "auto"}
5250
},
5351
5452
"contents": {
5553
"role": "user",
5654
"parts": {
57-
"text": "What can you do?"
55+
"text": "Turn on the lights please."
5856
}
5957
}
6058
}

0 commit comments

Comments
 (0)