I'm new in python and i want a little hand into this code. I'm developing a smart chatbot using the openai API and using it in what's app. I have this piece of my code that is responsible for the chatgpt response in my code. At the moment, this code is on model = "text-davinci-003" and i want to turn it into "gpt-3.5-turbo". Is any good soul interested in helping me?
Obs.: "msg" is what we ask to chatgpt
on whatsapp
The piece of my code:
msg = todas_as_msg_texto[-1]
print(msg) # -> Mensagem que o cliente manda (no caso eu)
cliente = 'msg do cliente: '
texto2 = 'Responda a mensagem do cliente com base no próximo texto: '
questao = cliente + msg + texto2 + texto
# #### PROCESSA A MENSAGEM NA API DO CHAT GPT ####
openai.api_key= apiopenai.strip()
response=openai.Completion.create(
model="text-davinci-003",
prompt=questao,
temperature=0.1,
max_tokens=270,
top_p=1,
frequency_penalty=0,
presence_penalty=0.6,
)
resposta=response['choices'][0]['text']
print(resposta)
time.sleep(1)