<?php
require 'vendor/autoload.php';
use GuzzleHttpClient;
function startQuiz() {
$client = new Client();
$apiKey = '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'; // Replace with your actual API key
try {
`so this is my code now how can add my assistans key`
$response = $client->request('POST', 'https://api.openai.com/v1/chat/completions', [
'headers' => [
'Authorization' => 'Bearer ' . $apiKey,
'Content-Type' => 'application/json'
],
'json' => [
'model' => 'gpt-4-1106-preview', // Your specific GPT-3.5-turbo model
'messages' => [
['role' => 'system', 'content' => 'You are a helpful assistant.'],
['role' => 'user', 'content' => 'start quiz Francals Highway Code multiple choose']
]
]
]);
$body = $response->getBody();
$content = json_decode($body);
echo $content->choices[0]->message->content;
} catch (Exception $e) {
echo 'Error in starting the quiz: ', $e->getMessage(), "n";
}
}
startQuiz();