The transition from Codex to GPT-3.5

Good day:) I have encountered a problem with writing code, in the settings of the text-davinci-003 model I set the value to 4,097 tokens, when the gpt-3.5-turbo model came out I replaced it, now when connecting an error appears saying that there is no such model gpt-3.5-turbo.

Defining settings for model

gpt4_settings = {
‘temperature’: 0.2,
‘max_tokens’: 4096,
‘top_p’: 1,
‘frequency_penalty’: 0,
‘presence_penalty’: 0,
‘engine’: ‘gpt-3.5-turbo’
Now when asking the gpt-3.5-turbo model, an error occurs
Cannot specify both model and engine. Did you mean to use v1/chat/completions?

How can I fix it?
Thank you:)

Welcome to the community @deniss.shevelev

Unlike text-davinci-003, gpt-3.5-turbo is a chat model and uses chat completions endpoint.

You should consider reading chat completion docs

Also, 'engine' param was deprecated a while ago, now only 'model' is used.

1 Like