#Getting a 500 Error while changing the model from davinci-003 to gpt-3.5-turbo

18 messages · Page 1 of 1 (latest)

bright blaze
#

Hey there.

I am getting a 500 Error while trying to run a script. This is the part that I changed to the new model:

// Call OpenAI language model for each prompt chunk var description = ""; for (var j = 0; j < promptChunks.length; j++) { var options = { "method": "post", "headers": { "Content-Type": "application/json", "Authorization": "Bearer " + api_key, }, "payload": JSON.stringify({ "model": "gpt-3.5-turbo", "messages": [{"role": "user", "content": promptChunks[j] + content.substring(0, 4000)}], "max_tokens": 2000, "temperature": 0.8, "stop": "\n", "n": 1 }), }; var response = UrlFetchApp.fetch("https://api.openai.com/v1/chat/completions", options); description += JSON.parse(response.getContentText()).choices[0].text.trim(); }

Error Message:

Exception: Request failed for https://api.openai.com returned code 500. Truncated server response: { "error": { "message": "The server had an error processing your request. Sorry about that! You can retry your request, or contact us through...

fringe lake
#

there isn’t a model like that

#

you can use text-davinci-003

brittle hound
#

10 x more expensive

bright blaze
#

yes, the new model is cheaper and I got better results with chatgpt than playground

brittle hound
#

same error for me

sacred marsh
#

I'm also getting the same error when trying the new gpt-3.5-turbo

bright blaze
brittle hound
#

Examples have not been updated any other docs?

fringe lake
sacred marsh
#

Docs are up to date https://platform.openai.com/docs/api-reference/chat

I was formatting my request badly at first, and errors were on point (like about a wrong string passed to the role property of a message).

After I fixed the errors, I started getting the generic errors like OP

bright blaze
sacred marsh
#

That’s what I’m using yeah

#

Also submitted a help ticket btw, will report back

bright blaze
#

Alright, enough headaches for today 😄 Hopefully this will be solved by tomorrow morning for us all.

Gonna keep you up to date!

sacred marsh
#

It’s working if I only pass messages and the model! Tomorrow I’ll try to add back one parameter at a time to see which one broke the request

#

I think it might have been the stop sequences array in my case, but at least I got it working now