Skip to content

Commit

Permalink
review feedback update
Browse files Browse the repository at this point in the history
  • Loading branch information
cynthiajoan committed Jan 24, 2025
1 parent 11e8876 commit 0f8e5c4
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ class _TokenCountPageState extends State<TokenCountPage> {
});

const prompt = 'tell a short story';
var content = Content.text(prompt);
var tokenResponse = await widget.model.countTokens([content]);
final content = Content.text(prompt);
final tokenResponse = await widget.model.countTokens([content]);
final tokenResult = 'Count token: ${tokenResponse.totalTokens}, billable '
'characters: ${tokenResponse.totalBillableCharacters}';
_messages.add(MessageData(text: tokenResult, fromUser: false));

var contentResponse = await widget.model.generateContent([content]);
final contentResponse = await widget.model.generateContent([content]);
final contentMetaData = 'result metadata, promptTokenCount:'
'${contentResponse.usageMetadata!.promptTokenCount}, '
'candidatesTokenCount:'
Expand Down

0 comments on commit 0f8e5c4

Please sign in to comment.