diff --git a/src/chatgpt/chatgpt.service.ts b/src/chatgpt/chatgpt.service.ts index 15dad3a..0e9ab97 100644 --- a/src/chatgpt/chatgpt.service.ts +++ b/src/chatgpt/chatgpt.service.ts @@ -35,7 +35,7 @@ export class ChatgptService { } let message = CHAT_GPT_PROMPT + '\n\n' + url; - '\n\n' + this.parsingService.getAllPlainText(htmlString); + '\n\n' + this.parsingService.getAllPlainText(htmlString).slice(2000); try { const resp = await axios.post( diff --git a/src/chatgpt/prompt.ts b/src/chatgpt/prompt.ts index bfcf8e3..e1db9f2 100644 --- a/src/chatgpt/prompt.ts +++ b/src/chatgpt/prompt.ts @@ -1,11 +1,11 @@ const CHAT_GPT_PROMPT = `I have texts from a website. Please tell me what the project is, and short description with its highlight in json format -desc should be short, between 15-20 word, must capture the main purpose -sometime it's come from github repo (I have url in first line), if so, the name should be "repoOwner/repoName", if not github +desc should be short, between 15-20 word, must capture the main purpose of the project, also tell what language/stack that work with this project, +some times it's come from github repo (url in first line), if so, the name should be "repoOwner/repoName" { "name": "foo", "desc": "foo is bar", -"tags" : "backend" | "frontend" | "terminal" | "framework" | "devops" | "deployment" | "auth" | "git" | "ide" | "service" // array of related tag, 3 max (less is better), only the core concept of the project, no space (use slash instead), 15 character max, abbrev only if it's commonly known +"tags" : "backend" | "frontend" | "terminal" | "framework" | "devops" | "deployment" | "auth" | "git" | "ide" | "service" // array of related tag, 3 max, less is better, only the core concept of the project, no space (use slash instead), 15 character max, abbrev only if it's commonly known } make sure that your answer don't have anything except json, not even the \`\`\` or \`\`\`json part diff --git a/src/parsing/parsing.service.ts b/src/parsing/parsing.service.ts index 276e108..7ab39d5 100644 --- a/src/parsing/parsing.service.ts +++ b/src/parsing/parsing.service.ts @@ -21,7 +21,7 @@ export class ParsingService { return text.trim(); } - public getAllPlainText(htmlString: string): unknown { + public getAllPlainText(htmlString: string): string { const dom = new JSDOM(htmlString); const tempDiv = dom.window.document.createElement('div'); tempDiv.innerHTML = htmlString;