Simple question for a simple chat

I’m trying out a new chat on a website, using my limited technical knowledge. I’m using PHP, HTML, CSS, JS. Technically, the chat works, but it provides responses that seem crazy. I even deleted the API and created a new one, thinking I did something wrong. But still, my chat gives all kinds of crazy responses.

This is the code I took from Playground:

curl https://api.openai.com/v1/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -d '{
  "model": "text-davinci-003",
  "prompt": "The following is a conversation with an AI assistant. The assistant is helpful, creative, clever, and very friendly.\n\nHuman: Hello, who are you?\nAI: I am an AI created by OpenAI. How can I help you today?\nHuman: in italiano per favore\n Ciao! Io sono un AI creato da OpenAI. Come posso aiutarti oggi?",
  "temperature": 0.9,
  "max_tokens": 150,
  "top_p": 1,
  "frequency_penalty": 0,
  "presence_penalty": 0.6,
  "stop": [" Human:", " AI:"]
}'```

thanks

Did you try playing with the temperate parameter? It can go from 0 to 2.
Zero means no creativity, provide the most accurate possible answer.
2 means it can be very creative and may make no sense.
you have almost 1 . Worth a try.

Switch to GPT for better chat responses.

See Chat Completion API Docs