Update (ai)

This commit is contained in:
2023-09-25 10:20:21 +08:00
parent 03e83f4786
commit b6f36e3ccd

View File

@@ -57,15 +57,15 @@ public static function suggestArticleTitles($current_title, $supporting_data, $s
return in following json format {\"main_keyword\":\"(Main Keyword)\",\"suggestions\":[{\"title\":\"(Title in 90-130 letters)\",\"short_title\":\"(Short Title in 30-40 letters)\",\"article_type\":\"(How-tos|Guides|Interview|Review|Commentary|Feature|News|Editorial|Report|Research|Case-study|Overview|Tutorial|Update|Spotlight|Insights)\",\"description\":\"(SEO description based on main keyword)\",\"photo_keywords\":[\"photo keyword 1\",\"photo keyword 2\"]}]}"; return in following json format {\"main_keyword\":\"(Main Keyword)\",\"suggestions\":[{\"title\":\"(Title in 90-130 letters)\",\"short_title\":\"(Short Title in 30-40 letters)\",\"article_type\":\"(How-tos|Guides|Interview|Review|Commentary|Feature|News|Editorial|Report|Research|Case-study|Overview|Tutorial|Update|Spotlight|Insights)\",\"description\":\"(SEO description based on main keyword)\",\"photo_keywords\":[\"photo keyword 1\",\"photo keyword 2\"]}]}";
$user_prompt = "Article Title: {$current_title}"; $user_prompt = "Article Title: {$current_title}\n Article Description: {$supporting_data}\n";
$reply = self::chatCompletion($system_prompt, $current_title, 'gpt-3.5-turbo'); $reply = self::chatCompletion($system_prompt, $user_prompt, 'gpt-3.5-turbo');
// try { try {
return json_decode($reply, false); return json_decode($reply, false);
// } catch (Exception $e) { } catch (Exception $e) {
// return null; return null;
// } }
} }