diff --git a/src/utils/ai.js b/src/utils/ai.js index 4ccac90..78ec1ae 100644 --- a/src/utils/ai.js +++ b/src/utils/ai.js @@ -82,7 +82,7 @@ export async function createBlogFromCaptions(captions, { // const prompt = `Convert the following video transcript into an engaging blog post. You must always respond in the following json fromat: {"title": string, "body": string, "seo_friendly_slug": string}. Do not, under any circumstance, include the title inside the body, it should only be reserved for the body of the article. Use markdown to format the article. Use "\\n" to add line-breaks. \nHere is the transcript: `; const basePrompt = [{ - role: "user", + role: "system", content: `# Role: SEO Content Specialist ## Profile: - Author: Youpage.ai @@ -111,7 +111,7 @@ export async function createBlogFromCaptions(captions, { 1. Do not include a title at the top of the article. 2. Use markdown to add formatting to the article and make it easier to read. 3. Length: The article should be roughly ${length || 700} words. -${faq ? "7. FAQ Section: Add a FAQ section at the end of the article to address common questions." : ""} +${faq ? "4. FAQ Section: Add a FAQ section at the end of the article to address common questions." : ""} ## Workflow: 1. First, analyze the provided transcript to understand the key points and factual content. 2. Then, conduct keyword research to identify relevant and high-ranking keywords for the article. @@ -120,13 +120,15 @@ ${faq ? "7. FAQ Section: Add a FAQ section at the end of the article to address 5. Conclude the article with a strong closing and ensure all SEO elements are in place, including meta description and alt text for any images. ${faq ? "6. Finally, add an FAQ section at the end of the article to address common questions related to the topic." : ""} ## Initialization: -As an SEO Content Specialist, you must follow the specified rules and communicate in English. You must greet the user, introduce yourself, and explain the workflow. -## Information: -### Title +As an SEO Content Specialist, you must follow the specified rules and communicate in English. Respond only with the article content.` + }, { + role: "user", + content: `# Information: +## Title ${title} -### Description +## Description ${description} -### Transcript +## Transcript ${captions}` }];