GithubHelp home page GithubHelp logo

Comments (6)

nikoandpiko avatar nikoandpiko commented on August 25, 2024 1

Thank you. We've not run into an error recently for the first two points, but I have added the debugs and we'll attempt to take care of them with that extra context. Thanks again for your assistance.

from julius-gpt.

christophebe avatar christophebe commented on August 25, 2024

Please send me an example code to reproduce the problem.

Thanks

from julius-gpt.

nikoandpiko avatar nikoandpiko commented on August 25, 2024

Thank you. I've simplified the code and tried including only the necessary code to debug. We use node to run:

import { OpenAIPostGenerator } from "julius-gpt";
import { marked } from 'marked';
import cors from 'cors';
import express from 'express';
import dotenv from 'dotenv';

// Dotenv Config
dotenv.config();

// Marked Config
marked.setOptions({
  mangle: false,
  headerIds: false
});

// App Config
const app = express();
const port = 3000;
app.use(express.json());
app.use(cors());

// Julius-GPT API
app.post('/', async (req, res) => {
  const prompt = {
    topic: req.body.message,
    withConclusion: true,
    model: "gpt-3.5-turbo",
    tone: 'informative',
    apiKey: process.env.OPENAI_API_KEY
  };

  const postGenerator = new OpenAIPostGenerator(prompt);

  try {
    const post = await postGenerator.generate();

    const { seoTitle, seoDescription, content, ...newPost } = post;
    newPost.seo_title = seoTitle;
    newPost.meta_description = seoDescription;
    newPost.body = marked(content);

    res.json(newPost);
  } catch (err) {
    console.error(err);
    res.status(500).json({ error: 'An error occurred while generating the post. Please try again.' });
  }
});

The prompt is entered into a textarea and the API is run when the generate button is clicked in our HTML:

<section class="prompt">
      <div>
        <label class="prompt-label">Prompt</label>
        <textarea id="prompt-input" class="prompt-input"></textarea>
      </div>

      <div>
        <button id="generate-btn" class="generate-btn">Generate</button>
      </div>
</section>

The JS logic behind displaying the content is not included here as the errors happen before it is generated.

  1. The timeout is quite long when the request fails i.e.,
⠼ Generating content ...OpenAI API - Request failed - Attempt 1 failed. There are 10 retries left. fetch failed

This happens randomly (15%~ of the time) and will appear some 10 minutes into content generation. I have seen one instance of the same message repeating after a second fail (instead of saying "Attempt 2 failed. There are 9 retries left").

  1. Around 15% of the time, a JSON syntax error occurs when generating and it stops the program i.e.,
✖ Generating post outline ...
SyntaxError: JSON5: invalid character '\"' at 15:1

This happens randomly when a user inputs a prompt in the aforementioned textarea. Only A~z and spaces have been used when this error occurs (no numbers, special characters, etc.)

  1. And one more point that I'd like to confrm. With this code at least, the average time for the content to be generated is 4m30s. Is it normal?

from julius-gpt.

christophebe avatar christophebe commented on August 25, 2024

Hello,

Issue 1 : probably an issue with OpenAPI. You can use the following options :
debug: true,
debugapi: true

You will get more info on the original issue.

Issue 2 : with the debug options, you will get more info. The prompt probably needs to be more precise to avoid this kind of problem.

Issue 3 : No. Normally, gpt-3.5-turbo is faster. Thanks to the debug log, you'll have additional information to see exactly what it's doing.

In conclusion, the debug options will give you a better understanding of the various problems. I think that one of the causes of the problems is GPT3.5-turbo itself. I get better results with GPT-4 for generating long texts.

from julius-gpt.

nikoandpiko avatar nikoandpiko commented on August 25, 2024

Excuse me for the long output, but after turning on debugging, these are the logs. Is it typical output? Average time to output is 4m30s.
Then, we do not have access to the GPT-4 API yet, so we will try that once we are given permissions.

OpenAI API initialized with model : gpt-3.5-turbo
---------- COMPLETION PARAMETERS ----------
Max Tokens  : undefined
Temperature : 0.8
Frequency Penalty : 0
Presence Penalty : 1
Logit Biais : undefined
✔  Init the completion parameters ...
---------- PROMPT OUTLINE ----------
Generate the blog post outline with the following json format : {"title": "", // Add the post title here "headings" : [ { "title": "", //Add the heading title here "keywords": ["...", "...", "...", "..."], // Add a list of keywords here. they will help to generate the final content of this heading."headings": [ // If necessary, add subheadings here. This is optional{ "title": "", "keywords": ["...", "..."] },{ "title": "", "keywords": ["...", "..."] }, ... ] } ... ],"slug" : "", // Use the main keywords for the slug based on the topic of the post. Do not mention the country.  Max 3 or 4 keywords, without stop words and with text normalization and accent stripping"seoTitle" : "", // not the same as the post tile, max 60 characters, do not mention the country"seoDescription : "" //max 155 characters }Do not add heading for an introduction, conclusion or to summarize the article.Market/country/region :undefined.Audience : undefined.Content intent : undefined.
⠋ Generating post outline ...sendMessage (263 tokens) {
  max_tokens: 1000,
  model: 'gpt-3.5-turbo',
  temperature: 0.8,
  top_p: 1,
  presence_penalty: 1,
  messages: [
    {
      role: 'system',
      content: 'You are a copywriter with a strong expertise in SEO. I need a detailed blog post in English about the topic : "AWS vs Azure".'
    },
    {
      role: 'user',
      content: 'Generate the blog post outline with the following json format : {"title": "", // Add the post title here "headings" : [ { "title": "", //Add the heading title here "keywords": ["...", "...", "...", "..."], // Add a list of keywords here. they will help to generate the final content of this heading."headings": [ // If necessary, add subheadings here. This is optional{ "title": "", "keywords": ["...", "..."] },{ "title": "", "keywords": ["...", "..."] }, ... ] } ... ],"slug" : "", // Use the main keywords for the slug based on the topic of the post. Do not mention the country.  Max 3 or 4 keywords, without stop words and with text normalization and accent stripping"seoTitle" : "", // not the same as the post tile, max 60 characters, do not mention the country"seoDescription : "" //max 155 characters }Do not add heading for an introduction, conclusion or to summarize the article.Market/country/region :undefined.Audience : undefined.Content intent : undefined.',
      name: undefined
    }
  ],
  stream: false
}
⠴ Generating post outline ...{
  id: 'chatcmpl-7YQVz37aXfXxle09K2ooo96icwUHL',
  object: 'chat.completion',
  created: 1688439431,
  model: 'gpt-3.5-turbo-0613',
  choices: [ { index: 0, message: [Object], finish_reason: 'stop' } ],
  usage: { prompt_tokens: 270, completion_tokens: 313, total_tokens: 583 }
}
---------- OUTLINE ----------
{
  "title": "AWS vs Azure: A Comprehensive Comparison of Cloud Computing Giants",
  "headings": [
    {
      "title": "Introduction to AWS and Azure",
      "keywords": ["AWS", "Azure", "cloud computing", "comparison"]
    },
    {
      "title": "Features and Services",
      "keywords": ["AWS services", "Azure services", "comparison"]
    },
    {
      "title": "Pricing and Cost",
      "keywords": ["AWS pricing", "Azure pricing", "comparison"]
    },
    {
      "title": "Scalability and Performance",
      "keywords": ["AWS scalability", "Azure scalability", "performance", "comparison"]
    },
    {
      "title": "Security and Compliance",
      "keywords": ["AWS security", "Azure security", "compliance", "comparison"]
    },
    {
      "title": "Market Share and Popularity",
      "keywords": ["AWS market share", "Azure market share", "popularity", "comparison"]
    },
    {
      "title": "Conclusion",
      "keywords": ["AWS vs Azure", "cloud computing", "comparison"]
    }
  ],
  "slug": "aws-azure-comparison",
  "seoTitle": "AWS vs Azure: Comparing the Leading Cloud Computing Providers",
  "seoDescription": "Discover the key differences between AWS and Azure, two major players in the cloud computing industry. Explore their features, pricing, scalability, security, market share, and more."
}
✔ Generating post outline ...
⠋ Generating introduction...sendMessage (668 tokens) {
  max_tokens: 1000,
  model: 'gpt-3.5-turbo',
  temperature: 0.8,
  top_p: 1,
  presence_penalty: 1,
  frequency_penalty: 0,
  messages: [
    {
      role: 'system',
      content: 'You are a copywriter with a strong expertise in SEO. I need a detailed blog post in English about the topic : "AWS vs Azure".'
    },
    {
      role: 'user',
      content: 'Generate the blog post outline with the following json format : {"title": "", // Add the post title here "headings" : [ { "title": "", //Add the heading title here "keywords": ["...", "...", "...", "..."], // Add a list of keywords here. they will help to generate the final content of this heading."headings": [ // If necessary, add subheadings here. This is optional{ "title": "", "keywords": ["...", "..."] },{ "title": "", "keywords": ["...", "..."] }, ... ] } ... ],"slug" : "", // Use the main keywords for the slug based on the topic of the post. Do not mention the country.  Max 3 or 4 keywords, without stop words and with text normalization and accent stripping"seoTitle" : "", // not the same as the post tile, max 60 characters, do not mention the country"seoDescription : "" //max 155 characters }Do not add heading for an introduction, conclusion or to summarize the article.Market/country/region :undefined.Audience : undefined.Content intent : undefined.',
      name: undefined
    },
    {
      role: 'assistant',
      content: '{\n' +
        '  "title": "AWS vs Azure: A Comprehensive Comparison of Cloud Computing Giants",\n' +
        '  "headings": [\n' +
        '    {\n' +
        '      "title": "Introduction to AWS and Azure",\n' +
        '      "keywords": ["AWS", "Azure", "cloud computing", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Features and Services",\n' +
        '      "keywords": ["AWS services", "Azure services", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Pricing and Cost",\n' +
        '      "keywords": ["AWS pricing", "Azure pricing", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Scalability and Performance",\n' +
        '      "keywords": ["AWS scalability", "Azure scalability", "performance", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Security and Compliance",\n' +
        '      "keywords": ["AWS security", "Azure security", "compliance", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Market Share and Popularity",\n' +
        '      "keywords": ["AWS market share", "Azure market share", "popularity", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Conclusion",\n' +
        '      "keywords": ["AWS vs Azure", "cloud computing", "comparison"]\n' +
        '    }\n' +
        '  ],\n' +
        '  "slug": "aws-azure-comparison",\n' +
        '  "seoTitle": "AWS vs Azure: Comparing the Leading Cloud Computing Providers",\n' +
        '  "seoDescription": "Discover the key differences between AWS and Azure, two major players in the cloud computing industry. Explore their features, pricing, scalability, security, market share, and more."\n' +
        '}',
      name: undefined
    },
    {
      role: 'user',
      content: 'Compose the introduction for this blog post topic, without using phrases such as "In this article,..." to introduce the subject.Instead, explain the context and/or explain the main problem. If possible, give some facts. Do not describe or introduce the content of the differents headings of the outline.Do not add a heading. Your responses should be in the markdown format. Do not add the title in the beginning of the introduction.',
      name: undefined
    }
  ],
  stream: false
}
⠹ Generating introduction...{
  id: 'chatcmpl-7YQW9e5Tm1VnL4ypNnQkiq3QrbTuW',
  object: 'chat.completion',
  created: 1688439441,
  model: 'gpt-3.5-turbo-0613',
  choices: [ { index: 0, message: [Object], finish_reason: 'stop' } ],
  usage: { prompt_tokens: 677, completion_tokens: 287, total_tokens: 964 }
}
✔ Generating introduction...

Heading : Introduction to AWS and Azure  ...'

⠋ Generating content ...sendMessage (666 tokens) {
  max_tokens: 1000,
  model: 'gpt-3.5-turbo',
  temperature: 0.8,
  top_p: 1,
  presence_penalty: 1,
  frequency_penalty: 0,
  messages: [
    {
      role: 'system',
      content: 'You are a copywriter with a strong expertise in SEO. I need a detailed blog post in English about the topic : "AWS vs Azure".'
    },
    {
      role: 'user',
      content: 'Generate the blog post outline with the following json format : {"title": "", // Add the post title here "headings" : [ { "title": "", //Add the heading title here "keywords": ["...", "...", "...", "..."], // Add a list of keywords here. they will help to generate the final content of this heading."headings": [ // If necessary, add subheadings here. This is optional{ "title": "", "keywords": ["...", "..."] },{ "title": "", "keywords": ["...", "..."] }, ... ] } ... ],"slug" : "", // Use the main keywords for the slug based on the topic of the post. Do not mention the country.  Max 3 or 4 keywords, without stop words and with text normalization and accent stripping"seoTitle" : "", // not the same as the post tile, max 60 characters, do not mention the country"seoDescription : "" //max 155 characters }Do not add heading for an introduction, conclusion or to summarize the article.Market/country/region :undefined.Audience : undefined.Content intent : undefined.',
      name: undefined
    },
    {
      role: 'assistant',
      content: '{\n' +
        '  "title": "AWS vs Azure: A Comprehensive Comparison of Cloud Computing Giants",\n' +
        '  "headings": [\n' +
        '    {\n' +
        '      "title": "Introduction to AWS and Azure",\n' +
        '      "keywords": ["AWS", "Azure", "cloud computing", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Features and Services",\n' +
        '      "keywords": ["AWS services", "Azure services", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Pricing and Cost",\n' +
        '      "keywords": ["AWS pricing", "Azure pricing", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Scalability and Performance",\n' +
        '      "keywords": ["AWS scalability", "Azure scalability", "performance", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Security and Compliance",\n' +
        '      "keywords": ["AWS security", "Azure security", "compliance", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Market Share and Popularity",\n' +
        '      "keywords": ["AWS market share", "Azure market share", "popularity", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Conclusion",\n' +
        '      "keywords": ["AWS vs Azure", "cloud computing", "comparison"]\n' +
        '    }\n' +
        '  ],\n' +
        '  "slug": "aws-azure-comparison",\n' +
        '  "seoTitle": "AWS vs Azure: Comparing the Leading Cloud Computing Providers",\n' +
        '  "seoDescription": "Discover the key differences between AWS and Azure, two major players in the cloud computing industry. Explore their features, pricing, scalability, security, market share, and more."\n' +
        '}',
      name: undefined
    },
    {
      role: 'user',
      content: 'Write an informative content for the heading (without the heading) : "Introduction to AWS and Azure" based on the following list of keywords : AWS, Azure, cloud computing, comparison.Do not start the first sentence with the heading. Instead, start with a sentence that introduces and provides context for the heading.Do not add a conclusion or a summary at the end of your answer. Your response should be in the markdown format.',
      name: undefined
    }
  ],
  stream: false
}
⠼ Generating content ...{
  id: 'chatcmpl-7YQWJgZ1Bjl1tqNPDQ0WuqkcWTZrt',
  object: 'chat.completion',
  created: 1688439451,
  model: 'gpt-3.5-turbo-0613',
  choices: [ { index: 0, message: [Object], finish_reason: 'stop' } ],
  usage: { prompt_tokens: 675, completion_tokens: 654, total_tokens: 1329 }
}

Heading : Features and Services  ...'

sendMessage (663 tokens) {
  max_tokens: 1000,
  model: 'gpt-3.5-turbo',
  temperature: 0.8,
  top_p: 1,
  presence_penalty: 1,
  frequency_penalty: 0,
  messages: [
    {
      role: 'system',
      content: 'You are a copywriter with a strong expertise in SEO. I need a detailed blog post in English about the topic : "AWS vs Azure".'
    },
    {
      role: 'user',
      content: 'Generate the blog post outline with the following json format : {"title": "", // Add the post title here "headings" : [ { "title": "", //Add the heading title here "keywords": ["...", "...", "...", "..."], // Add a list of keywords here. they will help to generate the final content of this heading."headings": [ // If necessary, add subheadings here. This is optional{ "title": "", "keywords": ["...", "..."] },{ "title": "", "keywords": ["...", "..."] }, ... ] } ... ],"slug" : "", // Use the main keywords for the slug based on the topic of the post. Do not mention the country.  Max 3 or 4 keywords, without stop words and with text normalization and accent stripping"seoTitle" : "", // not the same as the post tile, max 60 characters, do not mention the country"seoDescription : "" //max 155 characters }Do not add heading for an introduction, conclusion or to summarize the article.Market/country/region :undefined.Audience : undefined.Content intent : undefined.',
      name: undefined
    },
    {
      role: 'assistant',
      content: '{\n' +
        '  "title": "AWS vs Azure: A Comprehensive Comparison of Cloud Computing Giants",\n' +
        '  "headings": [\n' +
        '    {\n' +
        '      "title": "Introduction to AWS and Azure",\n' +
        '      "keywords": ["AWS", "Azure", "cloud computing", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Features and Services",\n' +
        '      "keywords": ["AWS services", "Azure services", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Pricing and Cost",\n' +
        '      "keywords": ["AWS pricing", "Azure pricing", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Scalability and Performance",\n' +
        '      "keywords": ["AWS scalability", "Azure scalability", "performance", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Security and Compliance",\n' +
        '      "keywords": ["AWS security", "Azure security", "compliance", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Market Share and Popularity",\n' +
        '      "keywords": ["AWS market share", "Azure market share", "popularity", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Conclusion",\n' +
        '      "keywords": ["AWS vs Azure", "cloud computing", "comparison"]\n' +
        '    }\n' +
        '  ],\n' +
        '  "slug": "aws-azure-comparison",\n' +
        '  "seoTitle": "AWS vs Azure: Comparing the Leading Cloud Computing Providers",\n' +
        '  "seoDescription": "Discover the key differences between AWS and Azure, two major players in the cloud computing industry. Explore their features, pricing, scalability, security, market share, and more."\n' +
        '}',
      name: undefined
    },
    {
      role: 'user',
      content: 'Write an informative content for the heading (without the heading) : "Features and Services" based on the following list of keywords : AWS services, Azure services, comparison.Do not start the first sentence with the heading. Instead, start with a sentence that introduces and provides context for the heading.Do not add a conclusion or a summary at the end of your answer. Your response should be in the markdown format.',
      name: undefined
    }
  ],
  stream: false
}
⠼ Generating content ...{
  id: 'chatcmpl-7YQWfPABUr8h5aUPf891WJycjgRhi',
  object: 'chat.completion',
  created: 1688439473,
  model: 'gpt-3.5-turbo-0613',
  choices: [ { index: 0, message: [Object], finish_reason: 'stop' } ],
  usage: { prompt_tokens: 672, completion_tokens: 686, total_tokens: 1358 }
}

Heading : Pricing and Cost  ...'

sendMessage (664 tokens) {
  max_tokens: 1000,
  model: 'gpt-3.5-turbo',
  temperature: 0.8,
  top_p: 1,
  presence_penalty: 1,
  frequency_penalty: 0,
  messages: [
    {
      role: 'system',
      content: 'You are a copywriter with a strong expertise in SEO. I need a detailed blog post in English about the topic : "AWS vs Azure".'
    },
    {
      role: 'user',
      content: 'Generate the blog post outline with the following json format : {"title": "", // Add the post title here "headings" : [ { "title": "", //Add the heading title here "keywords": ["...", "...", "...", "..."], // Add a list of keywords here. they will help to generate the final content of this heading."headings": [ // If necessary, add subheadings here. This is optional{ "title": "", "keywords": ["...", "..."] },{ "title": "", "keywords": ["...", "..."] }, ... ] } ... ],"slug" : "", // Use the main keywords for the slug based on the topic of the post. Do not mention the country.  Max 3 or 4 keywords, without stop words and with text normalization and accent stripping"seoTitle" : "", // not the same as the post tile, max 60 characters, do not mention the country"seoDescription : "" //max 155 characters }Do not add heading for an introduction, conclusion or to summarize the article.Market/country/region :undefined.Audience : undefined.Content intent : undefined.',
      name: undefined
    },
    {
      role: 'assistant',
      content: '{\n' +
        '  "title": "AWS vs Azure: A Comprehensive Comparison of Cloud Computing Giants",\n' +
        '  "headings": [\n' +
        '    {\n' +
        '      "title": "Introduction to AWS and Azure",\n' +
        '      "keywords": ["AWS", "Azure", "cloud computing", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Features and Services",\n' +
        '      "keywords": ["AWS services", "Azure services", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Pricing and Cost",\n' +
        '      "keywords": ["AWS pricing", "Azure pricing", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Scalability and Performance",\n' +
        '      "keywords": ["AWS scalability", "Azure scalability", "performance", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Security and Compliance",\n' +
        '      "keywords": ["AWS security", "Azure security", "compliance", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Market Share and Popularity",\n' +
        '      "keywords": ["AWS market share", "Azure market share", "popularity", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Conclusion",\n' +
        '      "keywords": ["AWS vs Azure", "cloud computing", "comparison"]\n' +
        '    }\n' +
        '  ],\n' +
        '  "slug": "aws-azure-comparison",\n' +
        '  "seoTitle": "AWS vs Azure: Comparing the Leading Cloud Computing Providers",\n' +
        '  "seoDescription": "Discover the key differences between AWS and Azure, two major players in the cloud computing industry. Explore their features, pricing, scalability, security, market share, and more."\n' +
        '}',
      name: undefined
    },
    {
      role: 'user',
      content: 'Write an informative content for the heading (without the heading) : "Pricing and Cost" based on the following list of keywords : AWS pricing, Azure pricing, comparison.Do not start the first sentence with the heading. Instead, start with a sentence that introduces and provides context for the heading.Do not add a conclusion or a summary at the end of your answer. Your response should be in the markdown format.',
      name: undefined
    }
  ],
  stream: false
}
⠸ Generating content ...{
  id: 'chatcmpl-7YQWzKDABGbARuKLLz0SZaAHo7tNw',
  object: 'chat.completion',
  created: 1688439493,
  model: 'gpt-3.5-turbo-0613',
  choices: [ { index: 0, message: [Object], finish_reason: 'stop' } ],
  usage: { prompt_tokens: 673, completion_tokens: 637, total_tokens: 1310 }
}

Heading : Scalability and Performance  ...'

sendMessage (667 tokens) {
  max_tokens: 1000,
  model: 'gpt-3.5-turbo',
  temperature: 0.8,
  top_p: 1,
  presence_penalty: 1,
  frequency_penalty: 0,
  messages: [
    {
      role: 'system',
      content: 'You are a copywriter with a strong expertise in SEO. I need a detailed blog post in English about the topic : "AWS vs Azure".'
    },
    {
      role: 'user',
      content: 'Generate the blog post outline with the following json format : {"title": "", // Add the post title here "headings" : [ { "title": "", //Add the heading title here "keywords": ["...", "...", "...", "..."], // Add a list of keywords here. they will help to generate the final content of this heading."headings": [ // If necessary, add subheadings here. This is optional{ "title": "", "keywords": ["...", "..."] },{ "title": "", "keywords": ["...", "..."] }, ... ] } ... ],"slug" : "", // Use the main keywords for the slug based on the topic of the post. Do not mention the country.  Max 3 or 4 keywords, without stop words and with text normalization and accent stripping"seoTitle" : "", // not the same as the post tile, max 60 characters, do not mention the country"seoDescription : "" //max 155 characters }Do not add heading for an introduction, conclusion or to summarize the article.Market/country/region :undefined.Audience : undefined.Content intent : undefined.',
      name: undefined
    },
    {
      role: 'assistant',
      content: '{\n' +
        '  "title": "AWS vs Azure: A Comprehensive Comparison of Cloud Computing Giants",\n' +
        '  "headings": [\n' +
        '    {\n' +
        '      "title": "Introduction to AWS and Azure",\n' +
        '      "keywords": ["AWS", "Azure", "cloud computing", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Features and Services",\n' +
        '      "keywords": ["AWS services", "Azure services", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Pricing and Cost",\n' +
        '      "keywords": ["AWS pricing", "Azure pricing", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Scalability and Performance",\n' +
        '      "keywords": ["AWS scalability", "Azure scalability", "performance", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Security and Compliance",\n' +
        '      "keywords": ["AWS security", "Azure security", "compliance", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Market Share and Popularity",\n' +
        '      "keywords": ["AWS market share", "Azure market share", "popularity", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Conclusion",\n' +
        '      "keywords": ["AWS vs Azure", "cloud computing", "comparison"]\n' +
        '    }\n' +
        '  ],\n' +
        '  "slug": "aws-azure-comparison",\n' +
        '  "seoTitle": "AWS vs Azure: Comparing the Leading Cloud Computing Providers",\n' +
        '  "seoDescription": "Discover the key differences between AWS and Azure, two major players in the cloud computing industry. Explore their features, pricing, scalability, security, market share, and more."\n' +
        '}',
      name: undefined
    },
    {
      role: 'user',
      content: 'Write an informative content for the heading (without the heading) : "Scalability and Performance" based on the following list of keywords : AWS scalability, Azure scalability, performance, comparison.Do not start the first sentence with the heading. Instead, start with a sentence that introduces and provides context for the heading.Do not add a conclusion or a summary at the end of your answer. Your response should be in the markdown format.',
      name: undefined
    }
  ],
  stream: false
}
⠙ Generating content ...{
  id: 'chatcmpl-7YQXIxgbOPWcZ1ULi8wmpNYwuStdA',
  object: 'chat.completion',
  created: 1688439512,
  model: 'gpt-3.5-turbo-0613',
  choices: [ { index: 0, message: [Object], finish_reason: 'stop' } ],
  usage: { prompt_tokens: 676, completion_tokens: 393, total_tokens: 1069 }
}

Heading : Security and Compliance  ...'

sendMessage (665 tokens) {
  max_tokens: 1000,
  model: 'gpt-3.5-turbo',
  temperature: 0.8,
  top_p: 1,
  presence_penalty: 1,
  frequency_penalty: 0,
  messages: [
    {
      role: 'system',
      content: 'You are a copywriter with a strong expertise in SEO. I need a detailed blog post in English about the topic : "AWS vs Azure".'
    },
    {
      role: 'user',
      content: 'Generate the blog post outline with the following json format : {"title": "", // Add the post title here "headings" : [ { "title": "", //Add the heading title here "keywords": ["...", "...", "...", "..."], // Add a list of keywords here. they will help to generate the final content of this heading."headings": [ // If necessary, add subheadings here. This is optional{ "title": "", "keywords": ["...", "..."] },{ "title": "", "keywords": ["...", "..."] }, ... ] } ... ],"slug" : "", // Use the main keywords for the slug based on the topic of the post. Do not mention the country.  Max 3 or 4 keywords, without stop words and with text normalization and accent stripping"seoTitle" : "", // not the same as the post tile, max 60 characters, do not mention the country"seoDescription : "" //max 155 characters }Do not add heading for an introduction, conclusion or to summarize the article.Market/country/region :undefined.Audience : undefined.Content intent : undefined.',
      name: undefined
    },
    {
      role: 'assistant',
      content: '{\n' +
        '  "title": "AWS vs Azure: A Comprehensive Comparison of Cloud Computing Giants",\n' +
        '  "headings": [\n' +
        '    {\n' +
        '      "title": "Introduction to AWS and Azure",\n' +
        '      "keywords": ["AWS", "Azure", "cloud computing", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Features and Services",\n' +
        '      "keywords": ["AWS services", "Azure services", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Pricing and Cost",\n' +
        '      "keywords": ["AWS pricing", "Azure pricing", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Scalability and Performance",\n' +
        '      "keywords": ["AWS scalability", "Azure scalability", "performance", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Security and Compliance",\n' +
        '      "keywords": ["AWS security", "Azure security", "compliance", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Market Share and Popularity",\n' +
        '      "keywords": ["AWS market share", "Azure market share", "popularity", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Conclusion",\n' +
        '      "keywords": ["AWS vs Azure", "cloud computing", "comparison"]\n' +
        '    }\n' +
        '  ],\n' +
        '  "slug": "aws-azure-comparison",\n' +
        '  "seoTitle": "AWS vs Azure: Comparing the Leading Cloud Computing Providers",\n' +
        '  "seoDescription": "Discover the key differences between AWS and Azure, two major players in the cloud computing industry. Explore their features, pricing, scalability, security, market share, and more."\n' +
        '}',
      name: undefined
    },
    {
      role: 'user',
      content: 'Write an informative content for the heading (without the heading) : "Security and Compliance" based on the following list of keywords : AWS security, Azure security, compliance, comparison.Do not start the first sentence with the heading. Instead, start with a sentence that introduces and provides context for the heading.Do not add a conclusion or a summary at the end of your answer. Your response should be in the markdown format.',
      name: undefined
    }
  ],
  stream: false
}
⠧ Generating content ...{
  id: 'chatcmpl-7YQXVhAw9KEtZ0otaHybhKrUM9gZM',
  object: 'chat.completion',
  created: 1688439525,
  model: 'gpt-3.5-turbo-0613',
  choices: [ { index: 0, message: [Object], finish_reason: 'stop' } ],
  usage: { prompt_tokens: 674, completion_tokens: 669, total_tokens: 1343 }
}

Heading : Market Share and Popularity  ...'

sendMessage (669 tokens) {
  max_tokens: 1000,
  model: 'gpt-3.5-turbo',
  temperature: 0.8,
  top_p: 1,
  presence_penalty: 1,
  frequency_penalty: 0,
  messages: [
    {
      role: 'system',
      content: 'You are a copywriter with a strong expertise in SEO. I need a detailed blog post in English about the topic : "AWS vs Azure".'
    },
    {
      role: 'user',
      content: 'Generate the blog post outline with the following json format : {"title": "", // Add the post title here "headings" : [ { "title": "", //Add the heading title here "keywords": ["...", "...", "...", "..."], // Add a list of keywords here. they will help to generate the final content of this heading."headings": [ // If necessary, add subheadings here. This is optional{ "title": "", "keywords": ["...", "..."] },{ "title": "", "keywords": ["...", "..."] }, ... ] } ... ],"slug" : "", // Use the main keywords for the slug based on the topic of the post. Do not mention the country.  Max 3 or 4 keywords, without stop words and with text normalization and accent stripping"seoTitle" : "", // not the same as the post tile, max 60 characters, do not mention the country"seoDescription : "" //max 155 characters }Do not add heading for an introduction, conclusion or to summarize the article.Market/country/region :undefined.Audience : undefined.Content intent : undefined.',
      name: undefined
    },
    {
      role: 'assistant',
      content: '{\n' +
        '  "title": "AWS vs Azure: A Comprehensive Comparison of Cloud Computing Giants",\n' +
        '  "headings": [\n' +
        '    {\n' +
        '      "title": "Introduction to AWS and Azure",\n' +
        '      "keywords": ["AWS", "Azure", "cloud computing", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Features and Services",\n' +
        '      "keywords": ["AWS services", "Azure services", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Pricing and Cost",\n' +
        '      "keywords": ["AWS pricing", "Azure pricing", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Scalability and Performance",\n' +
        '      "keywords": ["AWS scalability", "Azure scalability", "performance", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Security and Compliance",\n' +
        '      "keywords": ["AWS security", "Azure security", "compliance", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Market Share and Popularity",\n' +
        '      "keywords": ["AWS market share", "Azure market share", "popularity", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Conclusion",\n' +
        '      "keywords": ["AWS vs Azure", "cloud computing", "comparison"]\n' +
        '    }\n' +
        '  ],\n' +
        '  "slug": "aws-azure-comparison",\n' +
        '  "seoTitle": "AWS vs Azure: Comparing the Leading Cloud Computing Providers",\n' +
        '  "seoDescription": "Discover the key differences between AWS and Azure, two major players in the cloud computing industry. Explore their features, pricing, scalability, security, market share, and more."\n' +
        '}',
      name: undefined
    },
    {
      role: 'user',
      content: 'Write an informative content for the heading (without the heading) : "Market Share and Popularity" based on the following list of keywords : AWS market share, Azure market share, popularity, comparison.Do not start the first sentence with the heading. Instead, start with a sentence that introduces and provides context for the heading.Do not add a conclusion or a summary at the end of your answer. Your response should be in the markdown format.',
      name: undefined
    }
  ],
  stream: false
}
⠹ Generating content ...{
  id: 'chatcmpl-7YQXop7tELMUMBP2Xfj8NTEN0EaEi',
  object: 'chat.completion',
  created: 1688439544,
  model: 'gpt-3.5-turbo-0613',
  choices: [ { index: 0, message: [Object], finish_reason: 'stop' } ],
  usage: { prompt_tokens: 678, completion_tokens: 541, total_tokens: 1219 }
}

Heading : Conclusion  ...'

sendMessage (662 tokens) {
  max_tokens: 1000,
  model: 'gpt-3.5-turbo',
  temperature: 0.8,
  top_p: 1,
  presence_penalty: 1,
  frequency_penalty: 0,
  messages: [
    {
      role: 'system',
      content: 'You are a copywriter with a strong expertise in SEO. I need a detailed blog post in English about the topic : "AWS vs Azure".'
    },
    {
      role: 'user',
      content: 'Generate the blog post outline with the following json format : {"title": "", // Add the post title here "headings" : [ { "title": "", //Add the heading title here "keywords": ["...", "...", "...", "..."], // Add a list of keywords here. they will help to generate the final content of this heading."headings": [ // If necessary, add subheadings here. This is optional{ "title": "", "keywords": ["...", "..."] },{ "title": "", "keywords": ["...", "..."] }, ... ] } ... ],"slug" : "", // Use the main keywords for the slug based on the topic of the post. Do not mention the country.  Max 3 or 4 keywords, without stop words and with text normalization and accent stripping"seoTitle" : "", // not the same as the post tile, max 60 characters, do not mention the country"seoDescription : "" //max 155 characters }Do not add heading for an introduction, conclusion or to summarize the article.Market/country/region :undefined.Audience : undefined.Content intent : undefined.',
      name: undefined
    },
    {
      role: 'assistant',
      content: '{\n' +
        '  "title": "AWS vs Azure: A Comprehensive Comparison of Cloud Computing Giants",\n' +
        '  "headings": [\n' +
        '    {\n' +
        '      "title": "Introduction to AWS and Azure",\n' +
        '      "keywords": ["AWS", "Azure", "cloud computing", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Features and Services",\n' +
        '      "keywords": ["AWS services", "Azure services", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Pricing and Cost",\n' +
        '      "keywords": ["AWS pricing", "Azure pricing", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Scalability and Performance",\n' +
        '      "keywords": ["AWS scalability", "Azure scalability", "performance", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Security and Compliance",\n' +
        '      "keywords": ["AWS security", "Azure security", "compliance", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Market Share and Popularity",\n' +
        '      "keywords": ["AWS market share", "Azure market share", "popularity", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Conclusion",\n' +
        '      "keywords": ["AWS vs Azure", "cloud computing", "comparison"]\n' +
        '    }\n' +
        '  ],\n' +
        '  "slug": "aws-azure-comparison",\n' +
        '  "seoTitle": "AWS vs Azure: Comparing the Leading Cloud Computing Providers",\n' +
        '  "seoDescription": "Discover the key differences between AWS and Azure, two major players in the cloud computing industry. Explore their features, pricing, scalability, security, market share, and more."\n' +
        '}',
      name: undefined
    },
    {
      role: 'user',
      content: 'Write an informative content for the heading (without the heading) : "Conclusion" based on the following list of keywords : AWS vs Azure, cloud computing, comparison.Do not start the first sentence with the heading. Instead, start with a sentence that introduces and provides context for the heading.Do not add a conclusion or a summary at the end of your answer. Your response should be in the markdown format.',
      name: undefined
    }
  ],
  stream: false
}
⠸ Generating content ...{
  id: 'chatcmpl-7YQY4ZhXJVPgcCMjuBOZczHKP5YAE',
  object: 'chat.completion',
  created: 1688439560,
  model: 'gpt-3.5-turbo-0613',
  choices: [ { index: 0, message: [Object], finish_reason: 'stop' } ],
  usage: { prompt_tokens: 671, completion_tokens: 483, total_tokens: 1154 }
}
✔ Generating content ...
⠋ Generating conclusion...sendMessage (693 tokens) {
  max_tokens: 1000,
  model: 'gpt-3.5-turbo',
  temperature: 0.8,
  top_p: 1,
  presence_penalty: 1,
  frequency_penalty: 0,
  messages: [
    {
      role: 'system',
      content: 'You are a copywriter with a strong expertise in SEO. I need a detailed blog post in English about the topic : "AWS vs Azure".'
    },
    {
      role: 'user',
      content: 'Generate the blog post outline with the following json format : {"title": "", // Add the post title here "headings" : [ { "title": "", //Add the heading title here "keywords": ["...", "...", "...", "..."], // Add a list of keywords here. they will help to generate the final content of this heading."headings": [ // If necessary, add subheadings here. This is optional{ "title": "", "keywords": ["...", "..."] },{ "title": "", "keywords": ["...", "..."] }, ... ] } ... ],"slug" : "", // Use the main keywords for the slug based on the topic of the post. Do not mention the country.  Max 3 or 4 keywords, without stop words and with text normalization and accent stripping"seoTitle" : "", // not the same as the post tile, max 60 characters, do not mention the country"seoDescription : "" //max 155 characters }Do not add heading for an introduction, conclusion or to summarize the article.Market/country/region :undefined.Audience : undefined.Content intent : undefined.',
      name: undefined
    },
    {
      role: 'assistant',
      content: '{\n' +
        '  "title": "AWS vs Azure: A Comprehensive Comparison of Cloud Computing Giants",\n' +
        '  "headings": [\n' +
        '    {\n' +
        '      "title": "Introduction to AWS and Azure",\n' +
        '      "keywords": ["AWS", "Azure", "cloud computing", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Features and Services",\n' +
        '      "keywords": ["AWS services", "Azure services", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Pricing and Cost",\n' +
        '      "keywords": ["AWS pricing", "Azure pricing", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Scalability and Performance",\n' +
        '      "keywords": ["AWS scalability", "Azure scalability", "performance", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Security and Compliance",\n' +
        '      "keywords": ["AWS security", "Azure security", "compliance", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Market Share and Popularity",\n' +
        '      "keywords": ["AWS market share", "Azure market share", "popularity", "comparison"]\n' +
        '    },\n' +
        '    {\n' +
        '      "title": "Conclusion",\n' +
        '      "keywords": ["AWS vs Azure", "cloud computing", "comparison"]\n' +
        '    }\n' +
        '  ],\n' +
        '  "slug": "aws-azure-comparison",\n' +
        '  "seoTitle": "AWS vs Azure: Comparing the Leading Cloud Computing Providers",\n' +
        '  "seoDescription": "Discover the key differences between AWS and Azure, two major players in the cloud computing industry. Explore their features, pricing, scalability, security, market share, and more."\n' +
        '}',
      name: undefined
    },
    {
      role: 'user',
      content: 'Write a compelling conclusion for this blog post topic, without using transitional phrases such as "in conclusion," "in summary," "in short", "so", "thus", ... or any other transitional expressionFocus on summarizing the main points of the post, emphasizing the significance of the topic, and leaving the reader with a lasting impression or a thought-provoking final remark.Ensure that your conclusion effectively wraps up the article and reinforces the central message or insights presented in the blog post.Do not add a heading. Your responses should be in the markdown format.',
      name: undefined
    }
  ],
  stream: false
}
⠴ Generating conclusion...{
  id: 'chatcmpl-7YQYK6oDU6B8bkXaYO6xOyhdGiICA',
  object: 'chat.completion',
  created: 1688439576,
  model: 'gpt-3.5-turbo-0613',
  choices: [ { index: 0, message: [Object], finish_reason: 'stop' } ],
  usage: { prompt_tokens: 702, completion_tokens: 372, total_tokens: 1074 }
}
✔ Generating conclusion...

Tokens usually come out to around this much.

"totalTokens": {
    "promptTokens": 7861,
    "completionTokens": 4527,
    "total": 12388
  },

from julius-gpt.

christophebe avatar christophebe commented on August 25, 2024

It seems to work in this case. The log shows the last stage: conclusion.

I've just done a test with the CLI and GPT3-Turbo. It takes me 2.5 minutes to generate a content.
In any case, you'll never get the final output in less time, especially for long texts.

from julius-gpt.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.