File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -343,6 +343,9 @@ async function tokensSystemInstruction() {
343
343
const resultWithInstructions =
344
344
await modelWithInstructions . countTokens ( prompt ) ;
345
345
346
+ // The total token count includes everything sent to the
347
+ // generateContent() request. When you use system instructions, the
348
+ // total token count increases.
346
349
console . log ( resultWithInstructions ) ;
347
350
// { totalTokens: 23 }
348
351
// [END tokens_system_instruction]
@@ -379,6 +382,9 @@ async function tokensTools() {
379
382
380
383
const resultWithTools = await modelWithTools . countTokens ( prompt ) ;
381
384
385
+ // The total token count includes everything sent to the
386
+ // generateContent() request. When you use tools (like function calling),
387
+ // the total token count increases.
382
388
console . log ( resultWithTools ) ;
383
389
// { totalTokens: 99 }
384
390
// [END tokens_tools]
You can’t perform that action at this time.
0 commit comments