"gpt-4o-mini",
"messages" => [
["role" => "system", "content" => "You are a helpful assistant for Jollondon.com visitors."],
["role" => "user", "content" => $data["message"]]
]
]));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
"gpt-4o-mini",
"messages" => [
["role" => "system", "content" => "You are a friendly assistant for visitors of Jollondon.com. Keep answers short, professional, and helpful."],
["role" => "user", "content" => $user_message]
]
];
$ch = curl_init("https://api.openai.com/v1/chat/completions");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Content-Type: application/json",
"Authorization: Bearer $api_key"
]);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = curl_exec($ch);
curl_close($ch);
echo $response;
exit;
}
?>
Jollondon AI Chat
