I followed your instruction by giving it an example first and then asking to rewrite the next input:
$prompt = [
[
'role' => 'system',
'content' => 'You are a content writer for my blog. Write the post title based on the input.',
],
[
'role' => 'user',
'content' => 'Linux Kernel 6.6 Officially Confirmed as an LTS',
],
[
'role' => 'assistant',
'content' => 'Confirmation of Linux Kernel 6.6 as an Official LTS Version',
],
[
'role' => 'user',
'content' => $newTitleToRewrite,
],
];
Most of the time the new title is good, but there are still cases where whole sentence is wrapped in double quotes "
An alternative solution would be to just trim the quotes programmatically once I get the response from API.