From f399e287252b7a924c2bd920365a65ccb1aa60de Mon Sep 17 00:00:00 2001 From: charlesteh <39686678+charlesteh@users.noreply.github.com> Date: Mon, 2 Oct 2023 13:15:37 +0800 Subject: [PATCH] Update GenerateShopeeAIArticleTask.php --- app/Jobs/Tasks/GenerateShopeeAIArticleTask.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Jobs/Tasks/GenerateShopeeAIArticleTask.php b/app/Jobs/Tasks/GenerateShopeeAIArticleTask.php index 844b8fa..6bc7e24 100644 --- a/app/Jobs/Tasks/GenerateShopeeAIArticleTask.php +++ b/app/Jobs/Tasks/GenerateShopeeAIArticleTask.php @@ -45,6 +45,8 @@ public static function handle(ShopeeSellerScrape $shopee_seller_scrape) $excerpt = self::stripHtml($raw_html); + $excerpt = substr($excerpt, 0, 1500); // limit to 1500 characters due to OpenAI model limitations unless use 16k model, $$$$ + $excerpt .= self::getProductPricingExcerpt($shopee_task->product_task->response->jsonld); $photos = ShopeeSellerScrapedImage::where('shopee_seller_scrape_id', $shopee_seller_scrape->id)->where('featured', false)->orderByRaw('RAND()')->take(3)->get()->pluck('image')->toArray();