Both developer and assistant doens’t seem to be working for o3- mini - The only working one is user
2 Likes
I still use good old chat completion, which to me is the Swiss Army Knife of APIs. You will find that on the API level, it is the model for almost every other LLM basic API call structure.
At any rate, I just push everything to the model in the “user” role. However, I structure it, usually using XML, so that each section is clearly delineated for the model.
switch ($this->model) {
case 'o1-preview':
case 'o1-mini':
case 'o1':
case 'o3-mini':
$new = "\n\n";
$new .= 'System: ';
$new .= $systemMessage . "\n\n";
// If chat history is not empty
if (!empty($this->chatHistory)) {
$new .= $this->chatHistoryXML . "\n\n";
}
$new .= '<question>' . $userQuestion . '</question>';
$new .= "\n\n";
$new .= '<context>' . $contextDocuments . '</context>';
$new .= "\n\n";
$new .= 'Assistant: ';
$output = $new;
// Define the data for the API request
$data = array(
'messages' => array(
array("role" => "user", "content" => $output)
),
'model' => $this->model,
'max_completion_tokens' => $this->maxTokens,
'user' => $user
);
break;
}
Works every time. At least to the extent that I need it to work in my applications. And, as the models get smarter, they get better at following the prompts, including the “system” prompt.
system seems to work for o3-mini