From 5fa6308de976a796c25ba31cd69d41e4d8d1fe95 Mon Sep 17 00:00:00 2001 From: canterbery Date: Thu, 28 Sep 2023 18:15:42 +0300 Subject: [PATCH] wr-403: * prompts --- ...ticle-improvement-suggestions-completion-config.helper.ts | 2 +- .../get-detect-article-genre-completion-config.helper.ts | 2 +- .../libs/enums/article-prompt-completion-config.enum.ts | 2 +- package-lock.json | 5 ++++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/backend/src/packages/articles/libs/helpers/get-article-improvement-suggestions-completion-config.helper.ts b/backend/src/packages/articles/libs/helpers/get-article-improvement-suggestions-completion-config.helper.ts index 52322c71..6b2bbcf9 100644 --- a/backend/src/packages/articles/libs/helpers/get-article-improvement-suggestions-completion-config.helper.ts +++ b/backend/src/packages/articles/libs/helpers/get-article-improvement-suggestions-completion-config.helper.ts @@ -4,7 +4,7 @@ const getArticleImprovementSuggestionsCompletionConfig = ( text: string, ): CompletionConfig => { return { - prompt: `You'll be given a html markup of article and your task is to identify some points that you would suggest to change to make the article better. Ignore any html related issues - focus on article content. Provide the result in JSON format as an array of objects where each object has keys: title (title of suggestion), description (description of suggestion), and priority (can be 1, 2, or 3, it identifies the importance of suggestion, 1 - lowest priority, 3 - highest priority). Here's the article: ${text}`, + prompt: `You'll be given a html markup of article and your task is to identify some points that you would suggest to change to make the article better. Ignore any html related issues - focus on article content. Provide the result in JSON format as an array of objects where each object has keys: title (title of suggestion), description (description of suggestion), and priority (can be 1, 2, or 3, it identifies the importance of suggestion, 1 - lowest priority, 3 - highest priority).Provide no more than 5 suggestions. Here's the article: ${text}`, }; }; diff --git a/backend/src/packages/articles/libs/helpers/get-detect-article-genre-completion-config.helper.ts b/backend/src/packages/articles/libs/helpers/get-detect-article-genre-completion-config.helper.ts index daad4091..28bfacf8 100644 --- a/backend/src/packages/articles/libs/helpers/get-detect-article-genre-completion-config.helper.ts +++ b/backend/src/packages/articles/libs/helpers/get-detect-article-genre-completion-config.helper.ts @@ -4,7 +4,7 @@ import { UNKNOWN_GENRE_KEY } from '~/packages/genres/genre.js'; const getDetectArticleGenreCompletionConfig = ( text: string, ): CompletionConfig => ({ - prompt: `You will be provided with a html markup of an article, and your task is to extract a list of possible genres of that article. Provide your output in json format as an array of objects with keys name and key, where name is a readble name of the genre and key - a short snake cased representation of genre name. Place the most relevant genre at the 0 index. In case you can't indentify the genre put an object { key: "${UNKNOWN_GENRE_KEY}", name: "Unknown" } as the last item in resulting array. Here is the text: ${text}.`, + prompt: `You will be provided with a html markup of an article, and your task is to extract a list of possible genres (no more than 5) of that article. Provide your output in json format as an array of objects with keys name and key, where name is a readble name of the genre and key - a short snake cased representation of genre name. Place the most relevant genre at the 0 index. In case you can't indentify the genre put an object { key: "${UNKNOWN_GENRE_KEY}", name: "Unknown" } as the last item in resulting array. Here is the text: ${text}.`, }); export { getDetectArticleGenreCompletionConfig }; diff --git a/backend/src/packages/prompts/libs/enums/article-prompt-completion-config.enum.ts b/backend/src/packages/prompts/libs/enums/article-prompt-completion-config.enum.ts index cc1fa1e6..a80aab7d 100644 --- a/backend/src/packages/prompts/libs/enums/article-prompt-completion-config.enum.ts +++ b/backend/src/packages/prompts/libs/enums/article-prompt-completion-config.enum.ts @@ -1,6 +1,6 @@ const ArticlePromptCompletionConfig = { MESSAGE: - 'Your task is to generate a prompt for writing an article which will consist of the following components: genre, character, prop, situation and setting. You should generate a unique random value for each, so all of the elements create a consise and interesting article concept. Genre is any possible category of writing or literature. Provide your output in json format with the keys: genre, prop, character, situation, setting.', + 'Your task is to generate a prompt for writing an article which will consist of the following components: genre, character, prop, situation and setting. You should generate a unique random value no longer than 4 words for each, so all of the elements create a consise and interesting article concept. Genre is any possible category of writing or literature. Provide your output in json format with the keys: genre, prop, character, situation, setting.', TEMPERATURE: 1.5, } as const; diff --git a/package-lock.json b/package-lock.json index 7e3af19e..3dc35a33 100644 --- a/package-lock.json +++ b/package-lock.json @@ -94,7 +94,6 @@ }, "build": { "name": "bsa-2023-writorium", - "extraneous": true, "hasInstallScript": true, "workspaces": [ "shared", @@ -6145,6 +6144,10 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, + "node_modules/bsa-2023-writorium": { + "resolved": "build", + "link": true + }, "node_modules/buffer": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",