From c1c5f11a24a8af70eae55cd3777486fe39f10f28 Mon Sep 17 00:00:00 2001 From: jainefer Date: Tue, 20 Feb 2024 14:01:58 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20=EA=B2=80=EC=83=89=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/search.controller.js | 11 ++++++++++- src/services/chatGPT.service.js | 5 ++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/controllers/search.controller.js b/src/controllers/search.controller.js index e050fbe..4df3c05 100644 --- a/src/controllers/search.controller.js +++ b/src/controllers/search.controller.js @@ -6,6 +6,11 @@ import jwt from "jsonwebtoken"; export const vidoeSearchKeyWord= async (req,res)=>{ try { + if(req.query.keywordName=" "){ + res.send(response(status.SUCCESS,await viewSearchKeyword({ + "videos":[] + }))); + } const token = req.headers.authorization.split(' ')[1]; const decoded = jwt.verify(token, process.env.JWT_SECRET); req.userId = decoded.id; @@ -28,7 +33,11 @@ export const vidoeSearchTag = async (req, res)=>{ const token = req.headers.authorization.split(' ')[1]; const decoded = jwt.verify(token, process.env.JWT_SECRET); req.userId = decoded.id; - + if(req.query.hashtagName=" "){ + res.send(response(status.SUCCESS,await viewSearchKeyword({ + "videos":[] + }))); + } console.log("태그 검색을 요청하셨습니다"); const data={ "userId":req.userId, diff --git a/src/services/chatGPT.service.js b/src/services/chatGPT.service.js index 97d17e0..4798e79 100644 --- a/src/services/chatGPT.service.js +++ b/src/services/chatGPT.service.js @@ -13,9 +13,8 @@ export const chatGPTCall = async (scriptText) => { try { // ChatGPT에 전달할 프롬프트를 구성합니다. const system_prompt = - `Step 1. Look at the example Json given with the original script and give it to me in json. "subheading" is to break up the paragraphs of the given script according to the subtopics. The name of subheading is the title of the subtopic, and subheading.content should keep the original script divided according to the subtopic. subheading.name and subheading.content should be different. Add the contents in subheading together and we need to divide them so that the original script comes out. This subheading should be able to be at least 1 to highest 10 and contain all of the divided scripts. "tag" is the keyword for the overall scripts. Please indicate at least 2 to 5. The result should be in Korean. You need to have the above conditions and give them to the Json example below - {"subheading": [{"name": "Subtitle 1","content": "script 1"},{"name": "Subtitle 2","content": "script 2"}],"tag": [{"name": "Tag 1"},{"name": "Tag 2"},{"name": "Tag 3"}]} -`; + `Step 1. Look at the example Json given with the original script and give it to me in json. "subheading" is to break up the paragraphs of the given script according to the subtopics. The name of subheading is the title of the subtopic, and subheading.content should keep the "original" script divided according to the subtopic. subheading.name and subheading.content should be different. Add the contents in subheading together and we need to divide them so that the original script comes out.(If you put together the script you split, it should be the same as the original script) This subheading should be able to be at least 1 to highest 10 and contain all of the original scripts. "tag" is the keyword for the overall scripts. Please indicate at least 2 to 5. The result should be in Korean. You need to have the above conditions and give them to the Json example below + {"subheading": [{"name": "Subtitle 1","content": "dividen script of original script"},{"name": "Subtitle 2","content": "dividen script of original script"}],"tag": [{"name": "Tag 1"},{"name": "Tag 2"},{"name": "Tag 3"}]}`; const prompt = `Run this script from step 1 , Make sure to fulfill the condition given to the system promport. original script: ${scriptText}\n ` ;