mirror of
https://github.com/hwchase17/langchain
synced 2024-10-31 15:20:26 +00:00
b6f70d776b
I encountered this during summarization with VertexAI. I was receiving an INVALID_ARGUMENT error, as it was trying to send a list of about 17000 single characters. The [count_tokens method](https://github.com/googleapis/python-aiplatform/blob/main/vertexai/language_models/_language_models.py#L658) made available by Google takes in a list of prompts. It does not fail for small texts, but it does for longer documents because the argument list will be exceeding Googles allowed limit. Enforcing the list type makes it work successfully. This change will cast the input text to count to a list of that single text so that the input format is always correct. [Twitter](https://www.x.com/stijn_tratsaert) |
||
---|---|---|
.. | ||
cli | ||
experimental | ||
langchain |