Skip to content

Commit

Permalink
[fix] 검색 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
jainefer committed Feb 20, 2024
1 parent 10e7713 commit c1c5f11
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
11 changes: 10 additions & 1 deletion src/controllers/search.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand Down
5 changes: 2 additions & 3 deletions src/services/chatGPT.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ` ;

Expand Down

0 comments on commit c1c5f11

Please sign in to comment.