DEV Community

Alexey Kramin
Alexey Kramin

Posted on

How I built my first AI project for a couple of hours

Artificial Intelligence is here probably for ever. It becomes more and more widespread and usual, like personal computers or smartphones. And we wonโ€™t be able to imagine our lives without it very soon. To use it as a developer in your projects becomes incredibly easy too. I developed a simple tool using the OpenAI NPM package, and Iโ€™m going to share my approach. Letโ€™s go.

Idea

The main idea is pretty simple. I saw that many people on Twitter share their achievements, like MRR, subscribers numbers, or progress like lists, with emojis. For example:

๐Ÿงšโ€โ™‚๏ธ be fairy
๐Ÿ‘‘ be gorgeous
๐Ÿฆ„ be unique
๐Ÿณ be a whale
๐Ÿฆง be funny

I decided to create a tool that looks for appropriate emoji according to text provided.

Implementation

Letโ€™s start from the backend. Iโ€™m using Node.js so first of all I need to install OpenAI npm package. Then to use the package you need to obtain your API-key from open AI website.
When you finish all the preparation itโ€™s time to get you hands dirty. Init OpenAI package:

const { Configuration, OpenAIApi } = require('openai');
// Replace YOUR_API_KEY with your actual OpenAI API key
const API_KEY = process.env.OPENAI_API_KEY;
// Replace MODEL_ID with the ID of the model you want to use
// we are gonna use the chat completion functions so the following model id
// works there properly. Check in the API documentation if a model you wanna try
// works with selected API functions.
const MODEL_ID = 'gpt-3.5-turbo';
const configuration = new Configuration({
    apiKey: API_KEY,
});
const openai = new OpenAIApi(configuration);
Enter fullscreen mode Exit fullscreen mode

When we initialised the OpenAI object, we can call the API then:

const completion = await openai.createChatCompletion({
    model: MODEL_ID,
    messages: [{ "role": "user", "content": `generate exactly 5 funny and playful emojis for each paragraph of the input following the meaning of them. 
  Return it as JSON with an array of non empty strings containing exactly one emoji arrays.
  It shoudln't contain any additional keys in JSON. Only array of arrays. 
  Length of the array should be equal to ${count}. 
  No additional texts or explanations or extra array entities.
  The input: "${input.trim()}"` }]
});
const output = completion.data.choices[0].message.content;
Enter fullscreen mode Exit fullscreen mode

I tried to use Edits API first, but the result was not really predictable so I switched to ChatCompletion. Itโ€™s not perfect, but responses much more suitable.
Our output should look like a stringified JSON, but sometimes the AI returns not really expected response. So we need to be sure that we have a plan B if it could not be parsed properly.

let outputArray = [];
try {
  outputArray = JSON.parse(output
    .replaceAll(' ', '')
    .replaceAll('\n', '')
    .replaceAll('],]', ']]')
    .match(/\[(.|\n)*\]/g)[0] // get only array. There might be other info generated
    .trim()
  );
  outputArray = outputArray.map(arr => {
    if (arr.length) return arr;
    return getNRandomEmojis(5); // there might be an empty array
  });

  while (outputArray.length < input.length) {
    outputArray.push(getNRandomEmojis(5)); // length of any array might be less then we expeced (5)
  }
} catch (e) {
  console.error(e);
  const paragrapthsLength = input.length;
  for (let i = 0; i < paragrapthsLength; i++) { // just generate random emojis as a backup
    outputArray.push(getNRandomEmojis(5));
  }
}
Enter fullscreen mode Exit fullscreen mode

Now letโ€™s summarise everything we did and combine it into one file. The full code of the service looks as below.

async generateResponse(input) {
  // Replace YOUR_API_KEY with your actual OpenAI API key
  const API_KEY = process.env.OPENAI_API_KEY;
  // Replace MODEL_ID with the ID of the model you want to use
  // we are gonna use the chat completion functions so the following model id
  // works there properly. Check in the API documentation if a model you wanna try
  // works with selected API functions.
  const MODEL_ID = 'gpt-3.5-turbo';

  const configuration = new Configuration({
    apiKey: API_KEY,
  });
  const openai = new OpenAIApi(configuration);

  const inputStringified = input.map(inp => inp.val.trim()).join('\n');

  const completion = await openai.createChatCompletion({
    model: MODEL_ID,
    messages: [{ "role": "user", "content": getMessageContent(inputStringified, input.length) }]
  });

  const output = completion.data.choices[0].message.content;

  let outputArray = [];
  try {
    outputArray = JSON.parse(output
      .replaceAll(' ', '')
      .replaceAll('\n', '')
      .replaceAll('],]', ']]')
      .match(/\[(.|\n)*\]/g)[0] // get only array. There might be other info generated
      .trim()
    );
    outputArray = outputArray.map(arr => {
      if (arr.length) return arr;
      return getNRandomEmojis(5);
    });

    while (outputArray.length < input.length) {
      outputArray.push(getNRandomEmojis(5));
    }
  } catch (e) {
    console.error(e);
    const paragrapthsLength = input.length;
    for (let i = 0; i < paragrapthsLength; i++) {
      outputArray.push(getNRandomEmojis(5));
    }
  }

  return outputArray;
}

function getMessageContent(input, count) {
  return `generate exactly 5 funny and playful emojis for each paragraph of the input following the meaning of them. 
  Return it as JSON with an array of non empty strings containing exactly one emoji arrays.
  It shoudln't contain any additional keys in JSON. Only array of arrays. 
  Length of the array should be equal to ${count}. 
  No additional texts or explanations or extra array entities.
  The input: "${input.trim()}"`;
}

function getNRandomEmojis(n) {
  const res = [];
  for (let i = 0; i < n; i++) {
    res.push(getRandomEmoji());
  }
  return res;
}

function getRandomEmoji() {
  const emojis = [
    '๐Ÿ˜„', '๐Ÿ˜ƒ', '๐Ÿ˜€', '๐Ÿ˜Š', '๐Ÿ˜”', '๐Ÿ˜‰', '๐Ÿ˜', '๐Ÿ˜˜', '๐Ÿ˜š', '๐Ÿ˜—', '๐Ÿ˜™', '๐Ÿ˜œ', '๐Ÿ˜', '๐Ÿ˜›', '๐Ÿ˜ณ', '๐Ÿ˜', '๐Ÿ˜”', '๐Ÿ˜Œ', '๐Ÿ˜’', '๐Ÿ˜ž', '๐Ÿ˜ฃ', '๐Ÿ˜ข', '๐Ÿ˜‚', '๐Ÿ˜ญ', '๐Ÿ˜ช', '๐Ÿ˜ฅ', '๐Ÿ˜ฐ', '๐Ÿ˜…', '๐Ÿ˜“', '๐Ÿ˜ฉ', '๐Ÿ˜ซ', '๐Ÿ˜จ', '๐Ÿ˜ฑ', '๐Ÿ˜ ', '๐Ÿ˜ก', '๐Ÿ˜ค', '๐Ÿ˜–', '๐Ÿ˜†', '๐Ÿ˜‹', '๐Ÿ˜ท', '๐Ÿ˜Ž', '๐Ÿ˜ด', '๐Ÿ˜ต', '๐Ÿ˜ฒ', '๐Ÿ˜Ÿ', '๐Ÿ˜ฆ', '๐Ÿ˜ง', '๐Ÿ˜ˆ', '๐Ÿ‘ฟ', '๐Ÿ˜ฎ', '๐Ÿ˜ฌ', '๐Ÿ˜', '๐Ÿ˜•', '๐Ÿ˜ฏ', '๐Ÿ˜ถ', '๐Ÿ˜‡', '๐Ÿ˜', '๐Ÿ˜‘', '๐Ÿ‘ฒ', '๐Ÿ‘ณ', '๐Ÿ‘ฎ', '๐Ÿ‘ท', '๐Ÿ’‚', '๐Ÿ‘ถ', '๐Ÿ‘ฆ', '๐Ÿ‘ง', '๐Ÿ‘จ', '๐Ÿ‘ฉ', '๐Ÿ‘ด', '๐Ÿ‘ต', '๐Ÿ‘ฑ', '๐Ÿ‘ผ', '๐Ÿ‘ธ', '๐Ÿ˜บ', '๐Ÿ˜ธ', '๐Ÿ˜ป', '๐Ÿ˜ฝ', '๐Ÿ˜ผ', '๐Ÿ™€', '๐Ÿ˜ฟ', '๐Ÿ˜น', '๐Ÿ˜พ', '๐Ÿ‘น', '๐Ÿ‘บ', '๐Ÿ™ˆ', '๐Ÿ™‰', '๐Ÿ™Š', '๐Ÿ’€', '๐Ÿ‘ฝ', '๐Ÿ’ฉ', '๐Ÿ”ฅ', 'โœจ', '๐ŸŒŸ', '๐Ÿ’ซ', '๐Ÿ’ฅ', '๐Ÿ’ข', '๐Ÿ’ฆ', '๐Ÿ’ง', '๐Ÿ’ค', '๐Ÿ’จ', '๐Ÿ‘‚', '๐Ÿ‘€', '๐Ÿ‘ƒ', '๐Ÿ‘…', '๐Ÿ‘„', '๐Ÿ‘', '๐Ÿ‘Ž', '๐Ÿ‘Œ', '๐Ÿ‘Š', 'โœŠ', 'โœŒ', '๐Ÿ‘‹', 'โœ‹', '๐Ÿ‘', '๐Ÿ‘†', '๐Ÿ‘‡', '๐Ÿ‘‰', '๐Ÿ‘ˆ', '๐Ÿ™Œ', '๐Ÿ™', 'โ˜', '๐Ÿ‘', '๐Ÿ’ช', '๐Ÿšถ', '๐Ÿƒ', '๐Ÿ’ƒ', '๐Ÿ‘ซ', '๐Ÿ‘ช', '๐Ÿ‘ฌ', '๐Ÿ‘ญ', '๐Ÿ’', '๐Ÿ’‘', '๐Ÿ‘ฏ', '๐Ÿ™†', '๐Ÿ™…', '๐Ÿ’', '๐Ÿ™‹', '๐Ÿ’†', '๐Ÿ’‡', '๐Ÿ’…', '๐Ÿ‘ฐ', '๐Ÿ™Ž', '๐Ÿ™', '๐Ÿ™‡', '๐ŸŽฉ', '๐Ÿ‘‘', '๐Ÿ‘’', '๐Ÿ‘Ÿ', '๐Ÿ‘ž', '๐Ÿ‘ก', '๐Ÿ‘ ', '๐Ÿ‘ข', '๐Ÿ‘•', '๐Ÿ‘”', '๐Ÿ‘š', '๐Ÿ‘—', '๐ŸŽฝ', '๐Ÿ‘–', '๐Ÿ‘˜', '๐Ÿ‘™', '๐Ÿ’ผ', '๐Ÿ‘œ', '๐Ÿ‘', '๐Ÿ‘›', '๐Ÿ‘“', '๐ŸŽ€', '๐ŸŒ‚', '๐Ÿ’„', '๐Ÿ’›', '๐Ÿ’™', '๐Ÿ’œ', '๐Ÿ’š', 'โค', '๐Ÿ’”', '๐Ÿ’—', '๐Ÿ’“', '๐Ÿ’•', '๐Ÿ’–', '๐Ÿ’ž', '๐Ÿ’˜', '๐Ÿ’Œ', '๐Ÿ’‹', '๐Ÿ’', '๐Ÿ’Ž', '๐Ÿ‘ค', '๐Ÿ‘ฅ', '๐Ÿ’ฌ', '๐Ÿ‘ฃ', '๐Ÿ’ญ', '๐Ÿถ', '๐Ÿบ', '๐Ÿฑ', '๐Ÿญ', '๐Ÿน', '๐Ÿฐ', '๐Ÿธ', '๐Ÿฏ', '๐Ÿจ', '๐Ÿป', '๐Ÿท', '๐Ÿฝ', '๐Ÿฎ', '๐Ÿ—', '๐Ÿต', '๐Ÿ’', '๐Ÿด', '๐Ÿ‘', '๐Ÿ˜', '๐Ÿผ', '๐Ÿง', '๐Ÿฆ', '๐Ÿค', '๐Ÿฅ', '๐Ÿฃ', '๐Ÿ”', '๐Ÿ', '๐Ÿข', '๐Ÿ›', '๐Ÿ', '๐Ÿœ', '๐Ÿž', '๐ŸŒ', '๐Ÿ™', '๐Ÿš', '๐Ÿ ', '๐ŸŸ', '๐Ÿฌ', '๐Ÿณ', '๐Ÿ‹', '๐Ÿ„', '๐Ÿ', '๐Ÿ€', '๐Ÿƒ', '๐Ÿ…', '๐Ÿ‡', '๐Ÿ‰', '๐ŸŽ', '๐Ÿ', '๐Ÿ“', '๐Ÿ•', '๐Ÿ–', '๐Ÿ', '๐Ÿ‚', '๐Ÿฒ', '๐Ÿก', '๐ŸŠ', '๐Ÿซ', '๐Ÿช', '๐Ÿ†', '๐Ÿˆ', '๐Ÿฉ', '๐Ÿพ', '๐Ÿ’', '๐ŸŒธ', '๐ŸŒท', '๐Ÿ€', '๐ŸŒน', '๐ŸŒป', '๐ŸŒบ', '๐Ÿ', '๐Ÿƒ', '๐Ÿ‚', '๐ŸŒฟ', '๐ŸŒพ', '๐Ÿ„', '๐ŸŒต', '๐ŸŒด', '๐ŸŒฒ', '๐ŸŒณ', '๐ŸŒฐ', '๐ŸŒฑ', '๐ŸŒผ', '๐ŸŒ', '๐ŸŒž', '๐ŸŒ', '๐ŸŒš', '๐ŸŒ‘', '๐ŸŒ’', '๐ŸŒ“', '๐ŸŒ”', '๐ŸŒ•', '๐ŸŒ–', '๐ŸŒ—', '๐ŸŒ˜', '๐ŸŒœ', '๐ŸŒ›', '๐ŸŒ™', '๐ŸŒ', '๐ŸŒŽ', '๐ŸŒ', '๐ŸŒ‹', '๐ŸŒŒ', '๐ŸŒ ', 'โญ', 'โ˜€', 'โ›…', 'โ˜', 'โšก', 'โ˜”', 'โ„', 'โ›„', '๐ŸŒ€', '๐ŸŒ', '๐ŸŒˆ', '๐ŸŒŠ', '๐ŸŽ', '๐Ÿ’', '๐ŸŽŽ', '๐ŸŽ’', '๐ŸŽ“', '๐ŸŽ', '๐ŸŽ†', '๐ŸŽ‡', '๐ŸŽ', '๐ŸŽ‘', '๐ŸŽƒ', '๐Ÿ‘ป', '๐ŸŽ…', '๐ŸŽ„', '๐ŸŽ', '๐ŸŽ‹', '๐ŸŽ‰', '๐ŸŽŠ', '๐ŸŽˆ', '๐ŸŽŒ', '๐Ÿ”ฎ', '๐ŸŽฅ', '๐Ÿ“ท', '๐Ÿ“น', '๐Ÿ“ผ', '๐Ÿ’ฟ', '๐Ÿ“€', '๐Ÿ’ฝ', '๐Ÿ’พ', '๐Ÿ’ป', '๐Ÿ“ฑ', 'โ˜Ž', '๐Ÿ“ž', '๐Ÿ“Ÿ', '๐Ÿ“ ', '๐Ÿ“ก', '๐Ÿ“บ', '๐Ÿ“ป', '๐Ÿ”Š', '๐Ÿ”‰', '๐Ÿ”ˆ', '๐Ÿ”‡', '๐Ÿ””', '๐Ÿ”•', '๐Ÿ“ข', '๐Ÿ“ฃ', 'โณ', 'โŒ›', 'โฐ', 'โŒš', '๐Ÿ”“', '๐Ÿ”’', '๐Ÿ”', '๐Ÿ”', '๐Ÿ”‘', '๐Ÿ”Ž', '๐Ÿ’ก', '๐Ÿ”ฆ', '๐Ÿ”†', '๐Ÿ”…', '๐Ÿ”Œ', '๐Ÿ”‹', '๐Ÿ”', '๐Ÿ›', '๐Ÿ›€', '๐Ÿšฟ', '๐Ÿšฝ', '๐Ÿ”ง', '๐Ÿ”ฉ', '๐Ÿ”จ', '๐Ÿšช', '๐Ÿšฌ', '๐Ÿ’ฃ', '๐Ÿ”ซ', '๐Ÿ”ช', '๐Ÿ’Š', '๐Ÿ’‰', '๐Ÿ’ฐ', '๐Ÿ’ด', '๐Ÿ’ต', '๐Ÿ’ท', '๐Ÿ’ถ', '๐Ÿ’ณ', '๐Ÿ’ธ', '๐Ÿ“ฒ', '๐Ÿ“ง', '๐Ÿ“ฅ', '๐Ÿ“ค', 'โœ‰', '๐Ÿ“ฉ', '๐Ÿ“จ', '๐Ÿ“ฏ', '๐Ÿ“ซ', '๐Ÿ“ช', '๐Ÿ“ฌ', '๐Ÿ“ญ', '๐Ÿ“ฎ', '๐Ÿ“ฆ', '๐Ÿ“', '๐Ÿ“„', '๐Ÿ“ƒ', '๐Ÿ“‘', '๐Ÿ“Š', '๐Ÿ“ˆ', '๐Ÿ“‰', '๐Ÿ“œ', '๐Ÿ“‹', '๐Ÿ“…', '๐Ÿ“†', '๐Ÿ“‡', '๐Ÿ“', '๐Ÿ“‚', 'โœ‚', '๐Ÿ“Œ', '๐Ÿ“Ž', 'โœ’', 'โœ', '๐Ÿ“', '๐Ÿ“', '๐Ÿ“•', '๐Ÿ“—', '๐Ÿ“˜', '๐Ÿ“™', '๐Ÿ““', '๐Ÿ“”', '๐Ÿ“’', '๐Ÿ“š', '๐Ÿ“–', '๐Ÿ”–', '๐Ÿ“›', '๐Ÿ”ฌ', '๐Ÿ”ญ', '๐Ÿ“ฐ', '๐ŸŽจ', '๐ŸŽฌ', '๐ŸŽค', '๐ŸŽง', '๐ŸŽผ', '๐ŸŽต', '๐ŸŽถ', '๐ŸŽน', '๐ŸŽป', '๐ŸŽบ', '๐ŸŽท', '๐ŸŽธ', '๐Ÿ‘พ', '๐ŸŽฎ', '๐Ÿƒ', '๐ŸŽด', '๐Ÿ€„', '๐ŸŽฒ', '๐ŸŽฏ', '๐Ÿˆ', '๐Ÿ€', 'โšฝ', 'โšพ', '๐ŸŽพ', '๐ŸŽฑ', '๐Ÿ‰', '๐ŸŽณ', 'โ›ณ', '๐Ÿšต', '๐Ÿšด', '๐Ÿ', '๐Ÿ‡', '๐Ÿ†', '๐ŸŽฟ', '๐Ÿ‚', '๐ŸŠ', '๐Ÿ„', '๐ŸŽฃ', 'โ˜•', '๐Ÿต', '๐Ÿถ', '๐Ÿผ', '๐Ÿบ', '๐Ÿป', '๐Ÿธ', '๐Ÿน', '๐Ÿท', '๐Ÿด', '๐Ÿ•', '๐Ÿ”', '๐ŸŸ', '๐Ÿ—', '๐Ÿ–', '๐Ÿ', '๐Ÿ›', '๐Ÿค', '๐Ÿฑ', '๐Ÿฃ', '๐Ÿฅ', '๐Ÿ™', '๐Ÿ˜', '๐Ÿš', '๐Ÿœ', '๐Ÿฒ', '๐Ÿข', '๐Ÿก', '๐Ÿณ', '๐Ÿž', '๐Ÿฉ', '๐Ÿฎ', '๐Ÿฆ', '๐Ÿจ', '๐Ÿง', '๐ŸŽ‚', '๐Ÿฐ', '๐Ÿช', '๐Ÿซ', '๐Ÿฌ', '๐Ÿญ', '๐Ÿฏ', '๐ŸŽ', '๐Ÿ', '๐ŸŠ', '๐Ÿ‹', '๐Ÿ’', '๐Ÿ‡', '๐Ÿ‰', '๐Ÿ“', '๐Ÿ‘', '๐Ÿˆ', '๐ŸŒ', '๐Ÿ', '๐Ÿ', '๐Ÿ ', '๐Ÿ†', '๐Ÿ…', '๐ŸŒฝ', '๐Ÿ ', '๐Ÿก', '๐Ÿซ', '๐Ÿข', '๐Ÿฃ', '๐Ÿฅ', '๐Ÿฆ', '๐Ÿช', '๐Ÿฉ', '๐Ÿจ', '๐Ÿ’’', 'โ›ช', '๐Ÿฌ', '๐Ÿค', '๐ŸŒ‡', '๐ŸŒ†', '๐Ÿฏ', '๐Ÿฐ', 'โ›บ', '๐Ÿญ', '๐Ÿ—ผ', '๐Ÿ—พ', '๐Ÿ—ป', '๐ŸŒ„', '๐ŸŒ…', '๐ŸŒƒ', '๐Ÿ—ฝ', '๐ŸŒ‰', '๐ŸŽ ', '๐ŸŽก', 'โ›ฒ', '๐ŸŽข', '๐Ÿšข', 'โ›ต', '๐Ÿšค', '๐Ÿšฃ', 'โš“', '๐Ÿš€', 'โœˆ', '๐Ÿ’บ', '๐Ÿš', '๐Ÿš‚', '๐ŸšŠ', '๐Ÿš‰', '๐Ÿšž', '๐Ÿš†', '๐Ÿš„', '๐Ÿš…', '๐Ÿšˆ', '๐Ÿš‡', '๐Ÿš', '๐Ÿš‹', '๐Ÿšƒ', '๐ŸšŽ', '๐ŸšŒ', '๐Ÿš', '๐Ÿš™', '๐Ÿš˜', '๐Ÿš—', '๐Ÿš•', '๐Ÿš–', '๐Ÿš›', '๐Ÿšš', '๐Ÿšจ', '๐Ÿš“', '๐Ÿš”', '๐Ÿš’', '๐Ÿš‘', '๐Ÿš', '๐Ÿšฒ', '๐Ÿšก', '๐ŸšŸ', '๐Ÿš ', '๐Ÿšœ', '๐Ÿ’ˆ', '๐Ÿš', '๐ŸŽซ', '๐Ÿšฆ', '๐Ÿšฅ', 'โš ', '๐Ÿšง', '๐Ÿ”ฐ', 'โ›ฝ', '๐Ÿฎ', '๐ŸŽฐ', 'โ™จ', '๐Ÿ—ฟ', '๐ŸŽช', '๐ŸŽญ', '๐Ÿ“', '๐Ÿšฉ', 'โฌ†', 'โฌ‡', 'โฌ…', 'โžก', '๐Ÿ” ', '๐Ÿ”ก', '๐Ÿ”ค', 'โ†—', 'โ†–', 'โ†˜', 'โ†™', 'โ†”', 'โ†•', '๐Ÿ”„', 'โ—€', 'โ–ถ', '๐Ÿ”ผ', '๐Ÿ”ฝ', 'โ†ฉ', 'โ†ช', 'โ„น', 'โช', 'โฉ', 'โซ', 'โฌ', 'โคต', 'โคด', '๐Ÿ†—', '๐Ÿ”€', '๐Ÿ”', '๐Ÿ”‚', '๐Ÿ†•', '๐Ÿ†™', '๐Ÿ†’', '๐Ÿ†“', '๐Ÿ†–', '๐Ÿ“ถ', '๐ŸŽฆ', '๐Ÿˆ', '๐Ÿˆฏ', '๐Ÿˆณ', '๐Ÿˆต', '๐Ÿˆด', '๐Ÿˆฒ', '๐Ÿ‰', '๐Ÿˆน', '๐Ÿˆบ', '๐Ÿˆถ', '๐Ÿˆš', '๐Ÿšป', '๐Ÿšน', '๐Ÿšบ', '๐Ÿšผ', '๐Ÿšพ', '๐Ÿšฐ', '๐Ÿšฎ', '๐Ÿ…ฟ', 'โ™ฟ', '๐Ÿšญ', '๐Ÿˆท', '๐Ÿˆธ', '๐Ÿˆ‚', 'โ“‚', '๐Ÿ›‚', '๐Ÿ›„', '๐Ÿ›…', '๐Ÿ›ƒ', '๐Ÿ‰‘', 'ใŠ™', 'ใŠ—', '๐Ÿ†‘', '๐Ÿ†˜', '๐Ÿ†”', '๐Ÿšซ', '๐Ÿ”ž', '๐Ÿ“ต', '๐Ÿšฏ', '๐Ÿšฑ', '๐Ÿšณ', '๐Ÿšท', '๐Ÿšธ', 'โ›”', 'โœณ', 'โ‡', 'โŽ', 'โœ…', 'โœด', '๐Ÿ’Ÿ', '๐Ÿ†š', '๐Ÿ“ณ', '๐Ÿ“ด', '๐Ÿ…ฐ', '๐Ÿ…ฑ', '๐Ÿ†Ž', '๐Ÿ…พ', '๐Ÿ’ ', 'โžฟ', 'โ™ป', 'โ™ˆ', 'โ™‰', 'โ™Š', 'โ™‹', 'โ™Œ', 'โ™', 'โ™Ž', 'โ™', 'โ™', 'โ™‘', 'โ™’', 'โ™“', 'โ›Ž', '๐Ÿ”ฏ', '๐Ÿง', '๐Ÿ’น', '๐Ÿ’ฒ', '๐Ÿ’ฑ', 'ยฉ', 'ยฎ', 'โ„ข', 'ใ€ฝ', 'ใ€ฐ', '๐Ÿ”', '๐Ÿ”š', '๐Ÿ”™', '๐Ÿ”›', '๐Ÿ”œ', 'โŒ', 'โญ•', 'โ—', 'โ“', 'โ•', 'โ”', '๐Ÿ”ƒ', '๐Ÿ•›', '๐Ÿ•ง', '๐Ÿ•', '๐Ÿ•œ', '๐Ÿ•‘', '๐Ÿ•', '๐Ÿ•’', '๐Ÿ•ž', '๐Ÿ•“', '๐Ÿ•Ÿ', '๐Ÿ•”', '๐Ÿ• ', '๐Ÿ••', '๐Ÿ•–', '๐Ÿ•—', '๐Ÿ•˜', '๐Ÿ•™', '๐Ÿ•š', '๐Ÿ•ก', '๐Ÿ•ข', '๐Ÿ•ฃ', '๐Ÿ•ค', '๐Ÿ•ฅ', '๐Ÿ•ฆ', 'โœ–', 'โž•', 'โž–', 'โž—', 'โ™ ', 'โ™ฅ', 'โ™ฃ', 'โ™ฆ', '๐Ÿ’ฎ', '๐Ÿ’ฏ', 'โœ”', 'โ˜‘', '๐Ÿ”˜', '๐Ÿ”—', 'โžฐ', '๐Ÿ”ฑ', '๐Ÿ”ฒ', '๐Ÿ”ณ', 'โ—ผ', 'โ—ป', 'โ—พ', 'โ—ฝ', 'โ–ช', 'โ–ซ', '๐Ÿ”บ', 'โฌœ', 'โฌ›', 'โšซ', 'โšช', '๐Ÿ”ด', '๐Ÿ”ต', '๐Ÿ”ป', '๐Ÿ”ถ', '๐Ÿ”ท', '๐Ÿ”ธ', '๐Ÿ”น'
  ];
  return emojis[Math.floor(Math.random() * emojis.length)];
}
Enter fullscreen mode Exit fullscreen mode

Your front-end might look as you prefer. Example of mine is on the GIF

Emoji generator result of work

The tool itself - Emoji Me

Instead of a conclusion.

Itโ€™s was a tiny example of an AI application for some routine automations, but itโ€™s a step into very promising and intriguing AI world. There are so much interesting to discover so do it and enjoy.


If you like the article, follow me on social media โค๏ธ

Twitter

LinkedIn

Top comments (0)