llama_index icon indicating copy to clipboard operation
llama_index copied to clipboard

Is there an upper limit to the length of the "ask" method response string?

Open BrunoAPazetti opened this issue 2 years ago • 1 comments

When we create a Index using "GPTSimpleVectorIndex" the index becomes a class. So we can use the method "ask" of this class. Then we have a "response" as a result.

Is there an upper limit to the length of the ask method response string?

It seems to me that in some cases the response string is cut, when the sting response is big.

BrunoAPazetti avatar Mar 10 '23 17:03 BrunoAPazetti

@BrunoAPazetti the response string can be cut off, usually because the default max_tokens from a single OpenAI call is 256

See this page here for extending that: https://gpt-index.readthedocs.io/en/latest/how_to/custom_llms.html#example-changing-the-number-of-output-tokens-for-openai-cohere-ai21

logan-markewich avatar Mar 11 '23 03:03 logan-markewich

@logan-markewich's answer is right on. Closing issue for now.

Disiok avatar Mar 12 '23 03:03 Disiok

Thank you!

BrunoAPazetti avatar Mar 14 '23 14:03 BrunoAPazetti

@BrunoAPazetti the response string can be cut off, usually because the default max_tokens from a single OpenAI call is 256

See this page here for extending that: https://gpt-index.readthedocs.io/en/latest/how_to/custom_llms.html#example-changing-the-number-of-output-tokens-for-openai-cohere-ai21

Seems like this link no longer works. Is there another resource that describes how to fix this issue?

jmcrook avatar May 09 '23 01:05 jmcrook

@jmcrook

https://gpt-index.readthedocs.io/en/latest/how_to/customization/custom_llms.html#example-changing-the-number-of-output-tokens-for-openai-cohere-ai21

logan-markewich avatar May 09 '23 13:05 logan-markewich