#New GPT3.5 Models Not Working

4 messages · Page 1 of 1 (latest)

iron edge
#

Hi, I have code that gets OpenAI's models from the server and show all of them for the user to use. However, the newest models (gpt3.5, whisper-1, and embed), are not working anymore and are returned an "error 404" because the new models require different code request to run. I want the new code to specifically run for the gpt-3.5-turbo model with an: if (model === 'gpt-3.5-turbo'), like so: if (model === 'gpt-3.5-turbo') {
try {
const response = await axios({
method: 'POST',
headers: {
"Content-Type": 'application/json',
Authorization: Bearer ...,

            },
            url: 'https://api.openai.com/v1/chat/completions',
            data: {
                model: 'gpt-3.5-turbo',
                max_tokens: 500,
                temperature: 0.5,
                n: 1,
                messages: [
                    {
                        role: 'system',
                        content: prompt
                    },
                    {
                        role: 'user',
                        content: prompt
                    }
                ]
            }
        });
        res = response.data.choices[0].text;
    } catch (err) {
        res = `ChatGPT was unable to find an answer for that! (Error: ${err.message})`;
    }  

What am I doing wrong here that the model is still not responding? This is what ChatGPT suggested but idk what to do to implement it because I tried everything and it's still not working. This is my website which you can try to get an idea of what I'm talking about: https://chatgpt-messenger-mu.vercel.app/

trim horizon
#

Maybe messages all need to be in a single string instead of two different strings, but I dont know that for sure. Also you are using "prompt" for both system and user role, these should be two different variables and you need to make sure they are defined (wait or promised). You can also console.log at points to see what you are sending to openai, to make sure its what you think it is and nothing is missing. GPT can easily tell you the console.log command to use and where to put it

iron edge
#

Ah I see, got it, thanks

#

I'll try it