Update (ai): switch to gpt 3.5

This commit is contained in:
2023-11-23 17:36:05 +08:00
parent a321cdf819
commit e4eb51b2b7
2 changed files with 13 additions and 2 deletions

View File

@@ -8,6 +8,17 @@
class OpenAI
{
public static function getRssPostMetaGpt3($user_prompt, $model_max_tokens = 1536, $timeout = 60)
{
$openai_config = 'openai-gpt-3-5-turbo-1106';
$system_prompt = "Based on given article, populate the following in valid JSON format:\n{\n\"title\":\"(Title based on article)\",\n\"keywords\":[\"(Important keywords in 1-2 words per keyword, letters only)\"],\n\"category\":\"(Updates|Opinions|Features|New Launches|How Tos|Reviews)\",\n\"summary\":\"(Summarise in 50-80 words to help readers understand this article, US grade 9 english)\",\n\"entities\":[\"(List of identified human or business legal entites in 1-2 words per entity, letters only)\"],\n\"society_impact\":\"(Explain in 30-50 words how it impact society on technological aspect, US grade 9 english)\",\n\"society_impact_level\":\"(low|medium|high)\"\n}";
return self::getChatCompletion($user_prompt, $system_prompt, $openai_config, $model_max_tokens, $timeout);
}
public static function getRssPostMeta($user_prompt, $model_max_tokens = 1536, $timeout = 60)
{