Skip to content

How to get totalTokenCount from Response #58

Description

@ybsapp

Hi, how get tokenCount from this code

$chat = $client->generativeModel(ModelName::GEMINI_PRO)
->startChat()
->withHistory($history);

$response = $chat->sendMessage(new TextPart('in Go'));

i need totalTokenCount from response,

If i use request manual with guzzle, i have totalTokenCount from the response

so

Is there a way to get the All token count without making a request again?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions