Long empty response from chatgpt 3.5?

Often, Chat GPT-3.5 api starts returning me the markdown table I ask for but after like two names of the headers it starts returning a fully empty answer. It even takes more tokens than I set it up for (I have the limit set to 1k tokens and it takes full 2k completion tokens).

Is anyone else dealing with this issue? Any idea on how to fix it?

thanks!

Welcome to the Forum! I have seen this happen on rare occasions when the servers are experiencing an issue, if you try it now does it continue? If so can you post the output you get and the code that makes the API along with any setup code it relies upon.

Hi, thanks for the answer!

The output its something like:

content: '| Name | Description '… 117390 more characters

Sadly I can’t put the full input string here as we use it in our web app.

The code is something like this:

return fetch(chat completions link (cant include link on posts), {
method: ‘POST’,
headers: {
‘Content-Type’: ‘application/json’,
‘Authorization’: myapikey
},
body: JSON.stringify({
‘model’: ‘gpt-3.5-turbo’,
‘messages’: [{“role”:“system”,“content”:setup_prompt},{“role”:“user”,“content”:prompt}],
‘temperature’:0,
‘max_tokens’: 1500,
})

The setup prompt is always the same. Only prompt changes. I have seen this happen more frequently when people make prompts using lots of caps (but I often want to keep the caps for names). I feel like this is some kind of bug where the connection is interrupted or something, but it exceeding the token cap makes it weird.

Thanks!

Hi again,

Without seeing some examples of the exact prompt used, it’s hard to tell what might be causing it.