Page 1 of 2

[Issue] ChatGPT reply function doesn't work with gpt-3.5-turbo model

Posted: Fri Jun 02, 2023 11:46 am
by mihail
Hey, Martin!

It seems like OpenAI have changed their endpoints or there is some issue in the software.
ChatGPT replies in twitter dub with the davinci model works like a charm. But when I set model to "gpt-3.5-turbo" further completion requests fail with the following error:

chatgpt http: 404
https://api.openai.com/v1/completions
{
"error": {
"message": "This is a chat model and not supported in the v1/completions endpoint. Did you mean to use v1/chat/completions?",
"type": "invalid_request_error",
"param": "model",
"code": null
}
}
ERROR: chatgpt api request failed

Please, consider adding proper endpoint routing or at least a possibility to manually set API. <3

Re: [Issue] ChatGPT reply function doesn't work with gpt-3.5-turbo model

Posted: Fri Jun 02, 2023 3:20 pm
by martin@rootjazz
let me check. tbh I know nothing about openAI API options / settings.

I wasn't aware that changing the model changes the required payload...

Re: [Issue] ChatGPT reply function doesn't work with gpt-3.5-turbo model

Posted: Fri Jun 02, 2023 3:27 pm
by martin@rootjazz
ok yes, it needs different endpoints depending on the model


/v1/chat/completions gpt-4, gpt-4-0314, gpt-4-32k, gpt-4-32k-0314, gpt-3.5-turbo, gpt-3.5-turbo-0301
/v1/completions text-davinci-003, text-davinci-002, text-curie-001, text-babbage-001, text-ada-001

Re: [Issue] ChatGPT reply function doesn't work with gpt-3.5-turbo model

Posted: Fri Jun 02, 2023 3:27 pm
by martin@rootjazz
The next update will fix this. I shall let you know when it is ready.



Regards,
Martin

Re: [Issue] ChatGPT reply function doesn't work with gpt-3.5-turbo model

Posted: Fri Jun 02, 2023 7:58 pm
by martin@rootjazz

Re: [Issue] ChatGPT reply function doesn't work with gpt-3.5-turbo model

Posted: Fri Jun 02, 2023 9:35 pm
by mihail
Already fixed? wow cool! thank you
I'll test and report once see any problems.

Re: [Issue] ChatGPT reply function doesn't work with gpt-3.5-turbo model

Posted: Mon Jun 05, 2023 6:35 pm
by mihail
Hey,
I've tried the testing build you mentioned above.
Looks like messages are being sent to a proper endpoint, but the request itself causes the following error:

Code: Select all

{
    "error": {
        "message": "'messages' is a required property",
        "type": "invalid_request_error",
        "param": null,
        "code": null
    }
}
Kindly add respective request format for chat gpt completions. Refrence:
https://stackoverflow.com/questions/759 ... y-when-tes

Example:

Code: Select all

{
    "model": "gpt-3.5-turbo",
    "messages": [{"role": "user", "content":[b] Prompt+tweet message hier[/b]}],
    "max_tokens": 512,
    "top_p": 1,
    "temperature": 0.5,
    "frequency_penalty": 0,
    "presence_penalty": 0
}

Re: [Issue] ChatGPT reply function doesn't work with gpt-3.5-turbo model

Posted: Tue Jun 06, 2023 11:18 pm
by martin@rootjazz
:facepalm:

My apologies. I didn't think to check if the request body would need to be formatted differently, I should have expected this. Let me investigate and get it into the next update.

Sorry it's unlikely to be today but should be tomorrow



Regards,
Martin

Re: [Issue] ChatGPT reply function doesn't work with gpt-3.5-turbo model

Posted: Tue Jun 06, 2023 11:51 pm
by FPC2022
How are you using ChatGPT with the bot??

Re: [Issue] ChatGPT reply function doesn't work with gpt-3.5-turbo model

Posted: Wed Jun 07, 2023 11:55 am
by mihail
martin@rootjazz wrote: Tue Jun 06, 2023 11:18 pm :facepalm:

My apologies. I didn't think to check if the request body would need to be formatted differently, I should have expected this. Let me investigate and get it into the next update.

Sorry it's unlikely to be today but should be tomorrow



Regards,
Martin
Hehe
No problem! Just ping once it's been added to the testing build.
FPC2022 wrote: Tue Jun 06, 2023 11:51 pm How are you using ChatGPT with the bot??
I won't share a business scenario ;)
In case you asked about how to actually make TwitterDub use gpt completions this is how:
1. Added an openAI API key, prompt ("make an excited response to a tweet:") and model("text-davinci-003" for ex) to the global chatGPT settings (check the help menu)
2. Used the chat gpt token while sending tweets (it must work for dms as well but I haven't tested it)