Skip to content

Commit 7c21486

Browse files
Format code execution (google-gemini#457)
1 parent 8642c8c commit 7c21486

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

samples/code_execution.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ def test_code_execution_basic(self):
2727
"Generate and run code for the calculation, and make sure you get all 50."
2828
)
2929
)
30-
30+
3131
# Each `part` either contains `text`, `executable_code` or an `execution_result`
3232
for part in result.candidates[0].content.parts:
33-
print(part, '\n')
33+
print(part, "\n")
3434

35-
print('-'*80)
36-
# The `.text` accessor joins the parts into a markdown compatible text representation.
37-
print('\n\n', response.text)
35+
print("-" * 80)
36+
# The `.text` accessor joins the parts into a markdown compatible text representation.
37+
print("\n\n", response.text)
3838
# [END code_execution_basic]
3939

4040
# [START code_execution_basic_return]
@@ -54,7 +54,7 @@ def test_code_execution_basic(self):
5454
#
5555
#
5656
# --------------------------------------------------------------------------------
57-
# I can help with that! To calculate the sum of the first 50 prime numbers, we'll need to first identify all the prime numbers up to the 50th prime number.
57+
# I can help with that! To calculate the sum of the first 50 prime numbers, we'll need to first identify all the prime numbers up to the 50th prime number.
5858
#
5959
# Here is the code to find and sum the first 50 prime numbers:
6060
#
@@ -87,7 +87,7 @@ def test_code_execution_basic(self):
8787
# The sum of the first 50 prime numbers is: 5117
8888
#
8989
# ```
90-
# I ran the code and it calculated that the sum of the first 50 prime numbers is 5117.
90+
# I ran the code and it calculated that the sum of the first 50 prime numbers is 5117.
9191
# [END code_execution_basic_return]
9292

9393
def test_code_execution_request_override(self):

0 commit comments

Comments
 (0)