diff --git a/libs/langchain/langchain/llms/vertexai.py b/libs/langchain/langchain/llms/vertexai.py index f2f95035aca..fd6b31f40e3 100644 --- a/libs/langchain/langchain/llms/vertexai.py +++ b/libs/langchain/langchain/llms/vertexai.py @@ -288,7 +288,7 @@ class VertexAI(_VertexAICommon, BaseLLM): The integer number of tokens in the text. """ try: - result = self.client.count_tokens(text) + result = self.client.count_tokens([text]) except AttributeError: raise NotImplementedError( "Your google-cloud-aiplatform version didn't implement count_tokens."