From 953ccf9a761400eacf49ad52ce25bb1a8ba0a1ad Mon Sep 17 00:00:00 2001 From: Guillaume Vernade Date: Mon, 15 Jul 2024 10:45:53 -0400 Subject: [PATCH] Formatting (using black) --- samples/count_tokens.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/count_tokens.py b/samples/count_tokens.py index a45457e38..beae3b288 100644 --- a/samples/count_tokens.py +++ b/samples/count_tokens.py @@ -69,7 +69,7 @@ def test_tokens_chat(self): response = chat.send_message( "In one sentence, explain how a computer works to a young child." ) - + # On the response for `send_message`, use `usage_metadata` # to get separate input and output token counts # (`prompt_token_count` and `candidates_token_count`, respectively), @@ -195,7 +195,7 @@ def test_tokens_cached_content(self): # ( total_tokens: 9 ) response = model.generate_content(prompt) - + # On the response for `generate_content`, use `usage_metadata` # to get separate input and output token counts # (`prompt_token_count` and `candidates_token_count`, respectively), @@ -211,7 +211,7 @@ def test_tokens_system_instruction(self): # [START tokens_system_instruction] model = genai.GenerativeModel(model_name="gemini-1.5-flash") - prompt="The quick brown fox jumps over the lazy dog." + prompt = "The quick brown fox jumps over the lazy dog." print(model.count_tokens(prompt)) # total_tokens: 10 @@ -230,7 +230,7 @@ def test_tokens_tools(self): # [START tokens_tools] model = genai.GenerativeModel(model_name="gemini-1.5-flash") - prompt="I have 57 cats, each owns 44 mittens, how many mittens is that in total?" + prompt = "I have 57 cats, each owns 44 mittens, how many mittens is that in total?" print(model.count_tokens(prompt)) # ( total_tokens: 22 )