Find answers from the community

Updated 3 months ago

How can i limit the amount of characters

How can i limit the amount of characters inside the reponse of the Model?
I am using a OpenAI model
T
1 comment
Plain Text
Settings.llm = OpenAI(temperature=0, model="gpt-3.5-turbo", max_tokens=512)


Max tokens for a hard limit but you can also control the response lengths with your prompt https://docs.llamaindex.ai/en/stable/module_guides/models/llms/usage_custom.html#example-changing-the-number-of-output-tokens-for-openai-cohere-ai21
Add a reply
Sign up and join the conversation on Discord