diff --git a/google/generativeai/generative_models.py b/google/generativeai/generative_models.py index d2b02b1d8..f1725815b 100644 --- a/google/generativeai/generative_models.py +++ b/google/generativeai/generative_models.py @@ -275,13 +275,13 @@ def count_tokens( self, contents: content_types.ContentsType ) -> glm.CountTokensResponse: contents = content_types.to_contents(contents) - return self._client.count_tokens(self.model_name, contents) + return self._client.count_tokens(model=self.model_name, contents=contents) async def count_tokens_async( self, contents: content_types.ContentsType ) -> glm.CountTokensResponse: contents = content_types.to_contents(contents) - return await self._client.count_tokens(self.model_name, contents) + return await self._client.count_tokens(model=self.model_name, contents=contents) # fmt: on def start_chat(