Skip to content

Commit

Permalink
Merge pull request #424 from BinaryStudioAcademy/task/wr-403-OpenAI-p…
Browse files Browse the repository at this point in the history
…erformance-check

wr-403: OpenAI-performance-check
  • Loading branch information
andanf-e authored Sep 28, 2023
2 parents c39177a + c254898 commit 3fbc950
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}`,
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
5 changes: 4 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3fbc950

Please sign in to comment.