Skip to content

Commit 8494231

Browse files
authored
Formatting (using black) (#460)
1 parent 4e1dcd6 commit 8494231

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

samples/count_tokens.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def test_tokens_chat(self):
6969
response = chat.send_message(
7070
"In one sentence, explain how a computer works to a young child."
7171
)
72-
72+
7373
# On the response for `send_message`, use `usage_metadata`
7474
# to get separate input and output token counts
7575
# (`prompt_token_count` and `candidates_token_count`, respectively),
@@ -195,7 +195,7 @@ def test_tokens_cached_content(self):
195195
# ( total_tokens: 9 )
196196

197197
response = model.generate_content(prompt)
198-
198+
199199
# On the response for `generate_content`, use `usage_metadata`
200200
# to get separate input and output token counts
201201
# (`prompt_token_count` and `candidates_token_count`, respectively),
@@ -211,7 +211,7 @@ def test_tokens_system_instruction(self):
211211
# [START tokens_system_instruction]
212212
model = genai.GenerativeModel(model_name="gemini-1.5-flash")
213213

214-
prompt="The quick brown fox jumps over the lazy dog."
214+
prompt = "The quick brown fox jumps over the lazy dog."
215215

216216
print(model.count_tokens(prompt))
217217
# total_tokens: 10
@@ -230,7 +230,7 @@ def test_tokens_tools(self):
230230
# [START tokens_tools]
231231
model = genai.GenerativeModel(model_name="gemini-1.5-flash")
232232

233-
prompt="I have 57 cats, each owns 44 mittens, how many mittens is that in total?"
233+
prompt = "I have 57 cats, each owns 44 mittens, how many mittens is that in total?"
234234

235235
print(model.count_tokens(prompt))
236236
# ( total_tokens: 22 )

0 commit comments

Comments
 (0)