From 9ac344c414bb998835354618927e8679761f9a08 Mon Sep 17 00:00:00 2001 From: Charles Teh Date: Sun, 3 Dec 2023 02:40:48 +0800 Subject: [PATCH] Update (rss) --- app/Helpers/FirstParty/OpenAI/OpenAI.php | 2 +- app/Jobs/Tasks/ParseRssPostMetadataTask.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Helpers/FirstParty/OpenAI/OpenAI.php b/app/Helpers/FirstParty/OpenAI/OpenAI.php index 1c04047..5311b37 100644 --- a/app/Helpers/FirstParty/OpenAI/OpenAI.php +++ b/app/Helpers/FirstParty/OpenAI/OpenAI.php @@ -13,7 +13,7 @@ public static function getRssPostMetaGpt3($user_prompt, $model_max_tokens = 1536 $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\"is_ai_or_tech_news\":(true|false),\n\"is_government_or_political_news\":(true|false),\n\"keywords\":[\"(Important keywords in 1-2 words per keyword, letters only)\"],\n\"category\":\"(Updates|Opinions|Features|New Launches|How Tos|Reviews)\",\n\"entities\":[\"(List of identified human or business legal entites in 1-2 words per entity, letters only)\"],\n\"society_impact_level\":\"(low|medium|high)\"\n}"; + $system_prompt = "Based on given article title, populate the following in valid JSON format:\n{\n\"title\":\"(Title based on article)\",\n\"is_ai_or_tech_news\":(true|false),\n\"is_government_or_political_news\":(true|false),\n\"keywords\":[\"(Important keywords in 1-2 words per keyword, letters only)\"],\n\"category\":\"(Updates|Opinions|Features|New Launches|How Tos|Reviews)\",\n\"entities\":[\"(List of identified human or business legal entites in 1-2 words per entity, letters only)\"],\n\"society_impact_level\":\"(low|medium|high)\"\n}"; return self::getChatCompletion($user_prompt, $system_prompt, $openai_config, $model_max_tokens, $timeout); } diff --git a/app/Jobs/Tasks/ParseRssPostMetadataTask.php b/app/Jobs/Tasks/ParseRssPostMetadataTask.php index 2ca3df3..ec07e7b 100644 --- a/app/Jobs/Tasks/ParseRssPostMetadataTask.php +++ b/app/Jobs/Tasks/ParseRssPostMetadataTask.php @@ -26,7 +26,7 @@ public static function handle(int $rss_post_id) // return; // } - $final_content = "TITLE: {$rss_post->title} \n BODY:" . $rss_post->body; + $final_content = "TITLE: {$rss_post->title}"; if (in_array($rss_post->status, ['blocked', 'trashed'])) {