We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d0f3359 commit 74d67acCopy full SHA for 74d67ac
samples/rest/code_execution.sh
@@ -0,0 +1,15 @@
1
+set -eu
2
+
3
+echo "[START code_execution_basic]"
4
+# [START code_execution_basic]
5
+curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro-latest:generateContent?key=$GOOGLE_API_KEY" \
6
+-H 'Content-Type: application/json' \
7
+-d ' {"tools": ["code_execution"],
8
+ "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
+ }'
15
+# [END code_execution_basic]
0 commit comments