Skip to content

Commit a79d2aa

Browse files
authored
Fix example (#494)
Change-Id: I89d38b2fb38be407583ad1522b8b00a19efed03d
1 parent 74d67ac commit a79d2aa

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

samples/rest/code_execution.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ echo "[START code_execution_basic]"
44
# [START code_execution_basic]
55
curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro-latest:generateContent?key=$GOOGLE_API_KEY" \
66
-H 'Content-Type: application/json' \
7-
-d ' {"tools": ["code_execution"],
7+
-d ' {
8+
"tools": [{"code_execution": {}}],
89
"contents": {
9-
"parts":
10-
{"text": "What is the sum of the first 50 prime numbers? "
11-
"Generate and run code for the calculation, and make sure you get all 50."}
12-
}
13-
},
14-
}'
10+
"parts": {
11+
"text": "What is the sum of the first 50 prime numbers? Generate
12+
and run code for the calculation, and make sure you get all 50."
13+
}
14+
}
15+
}'
1516
# [END code_execution_basic]

0 commit comments

Comments
 (0)