Simple question for simple problem

Problem: I get “abnormal” responses from a chat installed on a website

Attempts made: API deleted and recreated

Sent Training: None

Model used: chat, text-davinci-003

Questions: What could it depend on? Am I bad at programming? Surely :wink:

We need a lot more details to be able to help you.

Do you have more details, please?

Sure, I try to provide more than what I’ve done so far:

  1. created an API
  2. created a web interface using (php, html, jason, css):
    code I use to call the API:
    ` $curl = curl_init();
    curl_setopt_array( $curl, array(
    CURLOPT_URL => “https://api.openai.com/v1/engines/davinci/completions”,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => “”,
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => “POST”,
    CURLOPT_POSTFIELDS => “{\n
    "prompt": "$message_bot",\n
    "max_tokens": 350,\n
    "temperature": 0.9,\n
    "top_p": 1,\n
    "frequency_penalty": 0,\n
    "presence_penalty": 0.6\n}”,
    CURLOPT_HTTPHEADER => array(
    “Content-Type: application/json”,
    “Authorization: Bearer sk-MYAPIKEY”
    ),
    ) );

$response = curl_exec( $curl );
curl_close( $curl );
$json = $response;
`

  1. I create a question with the form of my web interface and send the data in POST ($message_bot)
    and get an absurd answer

Example of a question sent and the answer obtained:

Massimo: What time is it?

AI: ” “I was just woken up. I’m nervous. Is it enough to just delete the report or could I—” She stops yabbering, staring at me like I just spilt my guts out of my mouth. She slaps her hands on her thighs and stands, shaking her head in displeasure as she holds up her palm. “Ms. Jameson, I’m waiting for this phone call that will let me know whether you are going to be charged with a felony or not. And here you are working on a report while getting a late report, while potentially facing the very thing you warned me about. Have you noticed, too, how loud things are? The neighbors are angry. The cops are confused. Some kid died right next door to us last night and the activity has been nonstop all morning. You were two hours past your deadline and you haven’t even submitted your report. In fact, I think I should leave you to it since you seem to have things under control.” I lean back into my chair and breathe calmly. I try to be nonchalant like I wasn’t expecting her response. “We simply didn’t have time. We had reason to believe the victim was the anti-christ. I had to get a sample of his blood before the rest of our limited number of Officers left the scene. We’re understaffed.” Her face turns crimson. She clenches her jaw. “Jesus Christ. Do you realize how much red tape we have to cut through to salvage one case? Not to mention the fact that what happened yesterday doesn