Add (ai gen): auto-select categories
This commit is contained in:
@@ -8,13 +8,15 @@
|
||||
|
||||
class OpenAI
|
||||
{
|
||||
public static function writeProductArticle($excerpt, $photos)
|
||||
public static function writeProductArticle($excerpt, $photos, $categories)
|
||||
{
|
||||
//$excerpt = substr($excerpt, 0, 1500);
|
||||
|
||||
$category_str = implode("|", $categories);
|
||||
|
||||
$system_prompt = '
|
||||
You are tasked with writing a comprehensive product introduction & review article using the provided excerpt. Write as if you are reviewing the product by a third party, but no pronouns.The emphasis should be on the performance, features, and notable aspects of the product. The review must not delve into marketplace-related information. Return the output in the following json format:\n\n
|
||||
{"title": "(Article Title, start with product name, 60-70 characters)","excerpt": "(One sentence summary, 150-160 characters of an article, do not use start sentence with verb.)","cliffhanger": "(One sentence 70-80 characters of article, cliff-hanging sentence to attract readers)","body": "(Markdown format, 700-900 word count)"}\n\n
|
||||
{"category":"('. $category_str .')","title": "(Article Title, start with product name, 60-70 characters)","excerpt": "(One sentence summary, 150-160 characters of an article, do not use start sentence with verb.)","cliffhanger": "(One sentence 70-80 characters of article, cliff-hanging sentence to attract readers)","body": "(Markdown format, 700-900 word count)"}\n\n
|
||||
Mandatory Requirements:\n
|
||||
- Write in US grade 8-9 English\n
|
||||
- Use the following sections whenever applicable:\n
|
||||
@@ -26,6 +28,7 @@ public static function writeProductArticle($excerpt, $photos)
|
||||
- do not make up facts, use facts provided by excerpt only\n
|
||||
- No article titles inside markdown\n
|
||||
- All article sections use ###
|
||||
- Pick the closest given category
|
||||
|
||||
';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user