#GPT response cutting off
35 messages · Page 1 of 1 (latest)
I'm having the same problem, only mine is about 2000 characters
The problem is that the max tokens you set is not enough for the model to complete the answer.
How would I limit the length of the response because sometimes it’s incredibly long
In what context are yo using the api?
For example in a chat you'll do:
AI: Hello!
USER: What's the meaning of life?
AI (short answer):
When I said hi it would send stuff like this
, that turned out to be the conclusion of my conversation with Rai-Lung and his men. They had told me the longer Han-tao was gone, the more heavily armed China would be forced to remain at the front. I hope this is not a good example for the Chinese, but it was a real doomsday scenario when he left. In any event, as soon as I heard he was moving against us, I dug in and began executing every Chinese without fail.
Hanging on this island is so crazy that I don't expect to ever get past it. It's just so high above the ocean. The whole island is another three miles above sea level. I need to use the helicopter again
Just HI?
Yea
How do I give context
How do I actually add it in though
In wich way are you communicating with openai?
Playground?
Api?
I was trying to make a discord bot with the api
In python?
Yea
#all your code
prompt = "You are a bot called {botname} that talks in a discord chat \n USER1:{first message} \n AI (short answer):"
#sending this to openai
Just add the context at the beginning
like you explain how the ai should behave
I added
prompt=f"You are a friendly chat bot that talks to {message.author.name} \n User: {message.content}"
And it’s responses are being cut off. I removed the max_tokens but that didn’t fix it
And it sometimes starts with “!”Or “?”
Not removing the max tokens, but putting it to a bigger value (like 1024)
Doesn’t it default to 1024
no default is 16
Oh
Do you know how I can fix this
Add \nAI: ad the end of the prompt