DEV Community

Cover image for How I am catching up with AI
Mark Kop
Mark Kop

Posted on

How I am catching up with AI

🌐 AI: The Game Changer

The world has seen an overwhelming surge in artificial intelligence (AI) advancements in recent months. AI refers to the development of machines or computer systems capable of performing tasks that usually require human intelligence.

A few notable examples of these leaps in AI technology include GPT-3.5, GPT-4, ChatGPT, Midjourney, Dall-e 2, AutoGPT, and Github Next.

These innovations have brought significant changes to various industries, from healthcare and finance to entertainment and education.


🤝 My Journey with AI: Copilot and ChatGPT

My journey with AI began almost a year ago when I started using Github Copilot, an AI-powered code completion tool that significantly changed my daily work life.

I'm also using ChatGPT, an AI language model, in nearly every aspect of my life, from drafting emails to brainstorming ideas.

Copilot and ChatGPT have boosted my productivity by at least 3x, allowing me to accomplish tasks more efficiently and effectively than ever before.


📰 Staying Informed: Newsletters and Twitter

It's challenging to stay abreast of the latest news in the AI world, but this isn't the first time I've felt this way.

I experienced similar feelings with blockchain and smart contracts. However, AI is different: it's not a niche technology; it's here to change everything.

To stay informed about the latest AI trends, I rely on Twitter and newsletters.

Here's what I would recommend following/subscribing:

Twitter profiles:

  • @mckaywrigley A guy that is building an AGI that builds web apps
  • @TheRundownAI An AI newsletter on Twitter with the latest news on AI developments

Newsletters:

  • AI Valley: Prompts, tools and updates about AI
  • The Prompt Report: Weekly reports with useful prompts and prompt engineering tips and tricks
  • Superpower ChatGPT: A daily AI newsletter inside a Chrome extension that adds a lot of features on top of the ChatGPT UI

💡 Applying AI to Real-life Problems

I'm always eager to apply the newest AI advancements in practical ways. Here are some of the things I tried:

🔸 Automation Scripts

The combo ChatGPT + Github Copilot is excellent for creating scripts that facilitate mundane tasks.

  • A script that automates the creation of GitHub pull requests for Jira issues, extracting the Jira ID and issue title from the branch name, and setting the appropriate label and target branch.

PR Script

  • A script that creates a new React component file with a given name and writes a basic functional component template with Tailwind CSS utility support inside a "components" directory.
#!/bin/bash

# Prompt user for the component name
echo "Enter the name of the React component in:"
read component_name
capitalized_name=$(perl -pe 's/^./\U$&/' <<< $component_name)

# Create the components directory if it doesn't already exist
if [ ! -d "components" ]; then
  mkdir components
fi

# Create the component file
touch "components/$component_name.js"
echo "import { twMerge } from 'tailwind-merge'

export function $capitalized_name({ className = '' }) {
  return (
    <div className={twMerge('', className)}>

    </div>
  )
}" > "components/$component_name.js"

echo "Successfully created React component file for $component_name!"
Enter fullscreen mode Exit fullscreen mode
  • An userscript that adds a button to the WebMotors website, which, when clicked, fetches and displays the FIPE price (a Brazilian vehicle pricing reference) for each car listing on the search results page.

WebMotors


🔸 Creating base code for components

Sometimes I try to evaluate how far we are in web development with the AI in charge. My last experiment was asking ChatGPT to create a progress bar component for me with a huge prompt.


🔸 Creating the foundation for a web app

I have this small side project that I always wanted to work on. It is a web app that aims to help the moderator of a werewolf/mafia party game to keep track of the players' roles and actions.

I had started it once and set everything up, but I didn't manage to keep working on it.

Luckily, when I wanted to continue the project, I had access to ChatGPT with GPT-4 and knew something about prompt engineering.

I described my entire application and added a few data structures.

feat: use chat gpt 4 to write the code #1

Initial prompt:

Write me the code for a React app that helps the moderator of a Mafia/Werewolf party game to track player roles and night actions. The app will have predefined roles and will allow the user to add players to the game before starting it. The app will have a few steps available to the user:
1) Add and remove players
2) Add and remove roles. It should also specify how many of each role will be in the game.
Then the game will randomly assign the roles to the players.
From now on, it should always display a table with the players, they roles. If they are dead, their names must be striked.
3) Night actions. Now each role that has an action will be able to perform a night action. Each role will be able have its own step and its own function that will interact with the game history.
Each role will have its own function code. Mafioso will be able to choose a target to kill. Sheriff will choose a target to find out if it is good or bad. Doctor will be able to select a target and prevent the death of that target for that night. Townies won't have night action.
5) After all night action steps, all actions will be resolved and a screen with the moderator announcement will appear with a summary of what happened that night, based on the previous steps. The summary may contain texts like "Player X died." or "No one died". The action resolver will set players as dead if the mafia targeted them and the doctor didn't target them, for example.
6) After that, the new step it's the discussion and voting step. A visual timer of 5 minutes will start. The user can prematurely click on the next step button to go to the next step if he wants.
7) On this next Hanging Step, the user may or may not select a player to set as dead, as consequence of possible voting.
8) Start night 2 and start from step 3.

Do these steps every night until there are only 2 players.

These are the starting roles:
export const existingRoles: Role[] = [
  {
    name: 'Townie',
    description: 'Find and kill the evildoers in the town.',
    alignment: 'Good',
    points: '1'
  },
  {
    name: 'Sheriff',
    description: 'Each night check if a player is "Good" or "Evil".',
    alignment: 'Good',
    points: '7'
  },
  {
    name: 'Doctor',
    description: 'Each night choose a player to heal. They cannot be killed that night.',
    alignment: 'Good',
    points: '4'
  },
  {
    name: 'Mafioso',
    description: 'Each night wake with the Mafia. You vote for a player to kill.',
    alignment: 'Evil',
    points: '-6'
  },
]

You may use any library that will make the code easier to maintain and save up code. Reuse the most code you can. Don't explain me your thinking or your code, just provide code snippets with the name of each file on top. Assume that the react project is already setup. Don't style anything.

The result was fantastic.
Over 20 files changed and 500+ additions.

Files changed

You can check the files and code on the Pull Request above.

You can also try out the ChatGPT code here:
https://werewolf-moderator-helper-9frdwh6ec-markkop.vercel.app/

Just make sure to match the number of players and roles before starting the game.

Or you can check out this GIF:

Demo

Sure, the app was not working 100% and there was a lot of stuff to implement, but having all the steps set up was a lot of effort saved.


🔸 AutoGPT

GitHub logo Significant-Gravitas / Auto-GPT

An experimental open-source attempt to make GPT-4 fully autonomous.

Auto-GPT: An Autonomous GPT-4 Experiment

Official Website Unit Tests Discord Follow GitHub Repo stars Twitter Follow

💡 Get help - Q&A or Discord 💬


🔴 USE stable not master 🔴

Download the latest stable release from here: https://github.com/Significant-Gravitas/Auto-GPT/releases/latest. The master branch is under heavy development and may often be in a broken state.


Auto-GPT is an experimental open-source application showcasing the capabilities of the GPT-4 language model. This program, driven by GPT-4, chains together LLM "thoughts", to autonomously achieve whatever goal you set. As one of the first examples of GPT-4 running fully autonomously, Auto-GPT pushes the boundaries of what is possible with AI.

Demo April 16th 2023

AutoGPTDemo_Subs_WithoutFinalScreen.mp4

Demo made by Blake Werlinger

💖 Help Fund Auto-GPT's Development 💖

If you can spare a coffee, you can help to cover the costs of developing Auto-GPT and help to push the boundaries of fully autonomous AI Your support is greatly appreciated. Development of this free, open-source project is made possible…

Of course, I had to play with AutoGPT, the current hot topic in the AI world.

After trying one thing or two, I asked it to help me with this blog post.
You can notice that at the very start of this article, I mentioned a few names related to AI: GPT-3.5, GPT-4, ChatGPT, Midjourney, Dall-e 2, AutoGPT and Github Next

I wanted to link those without the effort of having to get their links myself and format them to markdown, so I created a LinkGPT agent to that for me.

ai_goals:
  - Create a links.md file
  - Search the following on google, separately = GPT-3.5, GPT-4, ChatGPT, Midjourney, Dall-e 2, AutoGPT, and Github Next
  - For each result, create a markdown link with the "body" summarized and its "href", for example = [Summarized body up to 5 words](href). Append it to the links.md file.
ai_name: LinkGPT
ai_role: an IA designed to get and save links
Enter fullscreen mode Exit fullscreen mode

It worked to some extend, but since I didn't have access to the GPT-4 API, the AI was pretty bad at planning and executing its tasks with only GPT-3.5.

After a few hours of trial and error tweaking the AI goals and role, I had to do that manually.
But it was an wild experience nonetheless.
Being able to run this kind of technology on my own machine was impressive.


🎯 Pivoting to Prompt Engineering

As AI continues to advance, I've been contemplating a career pivot to become a Prompt Engineer. I believe that some developers may eventually be replaced by AI, and those who remain will be the ones who can harness AI's power to their advantage. Prompt Engineering, a field focused on crafting high-quality prompts that guide AI systems to generate useful outputs, is emerging as a crucial skill for developers who want to stay relevant in the age of AI.


🎉 Embracing the AI Revolution: A Look Back and Forward

As we've journeyed through the world of AI together, from groundbreaking advancements like GPT-3.5 and GPT-4 to practical applications and the importance of staying informed, it's clear that AI is reshaping our lives and industries at an unprecedented pace. My personal experiences with AI tools like Copilot and ChatGPT have demonstrated the immense potential of AI in boosting productivity and transforming workflows.

The realm of AI is vast, and it's essential to continue exploring new ways to apply this technology to real-life problems. By experimenting with AI-powered automation scripts, component creation, and even kickstarting web app development, we can witness firsthand the capabilities of AI to revolutionize our work and lives.

As the future unfolds, I'm excited to pivot towards Prompt Engineering, ensuring that I remain on the cutting edge of the AI revolution. This career shift not only allows me to harness the power of AI more effectively but also prepares me for the challenges and opportunities that lie ahead in this rapidly evolving landscape.

As we continue to embrace the AI revolution, let's stay curious, informed, and adaptable, ready to seize the opportunities that AI brings to improve our lives and shape the future. 🚀

Disclosure: This blog post was partially restructured with the assistance of AI

Top comments (8)

Collapse
 
joedorseyjr profile image
Joseph Dorsey Jr. • Edited

Smells like fear... here are a few words that I hope can help you. "You is smart, You is kind, You is important." You don't have become a "PROMPT ENGINEER".

Collapse
 
heymarkkop profile image
Mark Kop

Thank you for your kind words!
I have confidence in my abilities to excel in a development job, with or without the assistance of AI. However, I do recognize that in the future, AI will likely play a significant role in the work of developers. It will be essential to possess the skills necessary to effectively utilize these technologies.

Collapse
 
joedorseyjr profile image
Joseph Dorsey Jr.

For sure.💯🏃🏾‍♂️💨

Collapse
 
sherrydays profile image
Sherry Day

Nice post

Collapse
 
heymarkkop profile image
Mark Kop

Thanks!

Collapse
 
ehrbhein profile image
Irvin Gil

It's true that AI is here to revolutionize how we do things in the digital workplace. However, as a developer, I would still lean towards building applications with minimal dependence on AI. I don't ship out software that I don't know how to maintain and haven't fully considered the design. I learn from what I have experienced and built, and this holds true for most people. Nevertheless, I still wish you well on your new path. 👍

Collapse
 
heymarkkop profile image
Mark Kop

Thanks, Irvin!
I'm still thinking about pivoting - if that's even a thing really - to something like Prompt Engineering.
I 100% agree with you that knowing how to build and maintain software, with or without AI, must be a core skill for any developer.
Thanks again for your support!