Log in
Log into community
Find answers from the community
View all posts
Related posts
Did this answer your question?
๐
๐
๐
Powered by
Hall
Inactive
Updated 3 months ago
0
Follow
How can i limit the amount of characters
How can i limit the amount of characters
Inactive
0
Follow
F
Fran Piantoni
10 months ago
ยท
How can i limit the amount of characters inside the reponse of the Model?
I am using a OpenAI model
T
1 comment
Share
Open in Discord
T
Teemu
10 months ago
Plain Text
Copy
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
Join on Discord