The AI Engineer: The Future of Programming

IndyDevDan · Intermediate ·🧠 Large Language Models ·3y ago

Key Takeaways

The video demonstrates how to build a personal terminal AI using ChatGPT, OpenAI, and Python, showcasing the potential of LLMs in programming and automation. It covers setting up a terminal AI, interacting with the OpenAI chat completion endpoint, and automating tasks using AI.

Full Transcript

convert.jpgs into pngs just going to search and respond AI open Chrome on a specific URL just like that open dash a chrome and this is exactly how you run this command I want to show you guys what the future of programming can look like I'm going to put my decade of software experience to work and build an AI powered CLI assistant I'm going to put AI directly into the command line we're going to build it like we're in the future utilizing AI as our co-pilot normally when I record these Dev logs I've already written the app once what you're seeing here is one shot at building this application within 15 minutes all code will be in the description let's code proceeds first want to start the 15 minute timer and I've got I've got chat GPT open here I have a vs code window and I have time here running to keep track of my time let's jump right into this so all I have is open Ai and a dot m file and let's first generate the prompt I'm going to use to do the AI type terminal Auto completion so let's go ahead and make a prompt and let's give it the right instruction so you are terminal GPT you will auto complete terminal commands for Mac OS respond with only the command that fulfills the question probably suppose if those are on there but whatever question so we're going to have a question there and then answer there and let's just see how this runs so I'll leave out the answer part I don't think we actually need that and I'll just run question here so let's get the whole prompt in there and then I'm going to ask the question display the memory usage for the current directory let's fire that off gpt4 definitely takes some time but we get a command here so let's go ahead grab the command open up our shell and run it great so it looks like that works so uh so we've completed our first mission right we have a prompt that will when queried will respond with the proper shell command proper terminal command so next we need to build an application that allows us to run this in our terminal so I'm going to ask DBT to generate an application for us generate a simple python script that given a terminal given a question about a terminal command let's see how do we want to do this given a question about I don't want this to be too long I want to be short and concise that takes a string as an argument this argument is the is a question about a terminal command feed this question into the into the open AI chat completion endpoint with the prompt that we've created print the response and end the program so let's see what happens when we run this this is going to take some time so I'm going to go ahead and generate a new python file I want to sell these packages globally so we can run this terminal command anywhere and then solve art parse flip install open AI all right so it looks like we're going to have to fix the completion it's using the old DaVinci model we can update that we'll get rid of some of the parameters the answer looks okay and it looks like it's almost complete which is awesome so I'm going to copy this and do some code cleanup right away so here's the code open AI we have our purse this looks good description question art parse I would change question to just kill openai key I'm going to import dot m so I'm going to add M file support just so that we know we're doing this right I'm pretty sure it's not end and then you run load and something like that install yeah let's run this command exactly so let's get dot end up and running I'm going to copy code run that and then import from.m [Music] import load we're going to run that on Startup and that's going to give us our openai key which I have in the dot m file here let's go ahead and set that open AI perfect update this import OS now we have our openai key and now we can drop that here and let's go ahead and update we're going to use the GPT 3.5 Turbo and we have our prompt that looks great we have Max tokens and this looks good so now let's try to run our code and see what happens on our first run so python Main and just I'm going to pass in the question of the second parameter and see what happens so uh we'll do something simple uh lists all files in current directory sorted by created okay so namespace doesn't know how to do a question so R does that question looks like I am not passing in my parameter correctly um let's ask GPT how exactly I pass in an argument so how would I call python main.py with the parameter let's go ahead and send that see what it says python Main I see I dropped Q and it's all over places I'll put a question back that'll go through my argument back let's go ahead and run this again see what we get do I need to use chat completions I definitely did I need to switch this to chat completion um I think that's the right endpoint yeah that looks right so let's go ahead and run again okay invalid URL let's see what's happening here okay I have the uh parameters wrong so with the chat completion you run model here as the key and then you run messages equals um how does this work role user content prompt and I'll move prompt here to a variable everything else should be fine all right that looks good let's go ahead and run this again okay we have invalid requests let's see what's happening here let's ask GPT to fix this for us see what's going on I have this error what should I do foreign I have a tuple here because there's a trailing Comma just because I copy and pasted the code incorrectly so I'm going to get rid of that and we're going to rerun okay and so it looks like we got a response but there's no attribute text because this is the wrong response format so let's go ahead and just dump out the response from the open AI endpoint and just run again we'll get the same error but we'll get the format so I'm looking for choices zeroth index message dot content and we can see it's past the response back so we have two minutes 30 seconds left let's go ahead and finish up so let's run this again and just like that you can see we get the command back in the format that we expect so that's fantastic so let's go ahead and wrap things up here we're going to get rid of this we're going to print the answer and we're going to go ahead and now make our Python program run anywhere by opening our bash profile and I'm going to just jump to the bottom here and create a brand new command that allows me to run this python script from any word in my terminal so I'm going to create a bash function we're going to call it AI and all it's going to do is run python on the AI we'll call it CLI AI path and this is going to be a path directly to this python file so I'm just going to run PWD to get the path I'm going to clip copy to my clipboard and then I'm going to paste that in and then slash main.py so we run our python file and then I'm just going to run this path in Python so I'm going to run python on this file and then I'm going to pass in our question which will be the first parameter and in bash you use dollar sign one and that should be it guys so let's go ahead and hop in the terminal all right so now I'm going to ask a question to the terminal let's do something we've just done so I'm just going to say AI space list all py files in the current directory okay so that's how I do is I do LS star Dot py and hit enter no matches so let's move somewhere where there are python file and let's run this one more time as our times up here I'll run LS startup py and that's exactly how it works all right so time's up in just 15 minutes I was able to put artificial intelligence into my command line now anytime I have a question anytime you have a question about a the Astro terminal command that you don't know you can just come to your terminal and ask bash Alias Ai and then you can just ask any questions so let's say I want to convert jpgs into pngs it's going to search and respond so there's a command that I could run I might need the sips library or package or whatever it is but this is really cool guys so now all I do is I type Ai and then I ask questions in the terminal so for instance let's ask one more question AI open Chrome on a specific URL just like that open dash a chrome and this is exactly how you run this command so this is really cool guys um really powerful technology I'm going to put the code I'm going to put the link in the description of the code so you guys can get this up and running and even less time than I built this so this is really cool stuff I hope you guys enjoyed this video If you like this if you want to become an AI engineer if you want to follow along all this amazing technology that's being created hit the like button subscribe I am all about this stuff I'm all in it because AI presents the most interesting Arbitrage opportunity for engineers and product Builders probably of our entire lifetime because this is going to give us the ability to scale our impact to unknown levels things are just heating up thank you so much for watching I'll see you guys in the next one

Original Description

💻 Get the Code and Setup your personal terminal AI: https://danisler.com/dev/personal-gpt-terminal-ai ✅ Use Notion? Love Being Productive? Convert your Notion pages to Personal Audio Books https://subvolver.com ⏳ Manage your time - your way https://timeva.com #️⃣ Hashtags #chatgpt #gpt4 #python
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from IndyDevDan · IndyDevDan · 40 of 60

1 Senior developer codes ENTIRE electron app in 30 days (not for beginners)
Senior developer codes ENTIRE electron app in 30 days (not for beginners)
IndyDevDan
2 How I code custom components with vue.js, electron and GitHub Copilot (ASMR)
How I code custom components with vue.js, electron and GitHub Copilot (ASMR)
IndyDevDan
3 Coding a progress bar using vue.js, progressbar.js, pinia, and electron
Coding a progress bar using vue.js, progressbar.js, pinia, and electron
IndyDevDan
4 Vue + Electron settings menu and switch component wrapper (GitHub Copilot FTW)
Vue + Electron settings menu and switch component wrapper (GitHub Copilot FTW)
IndyDevDan
5 Zen mode, Hot keys, and circle progress bar in vue.js
Zen mode, Hot keys, and circle progress bar in vue.js
IndyDevDan
6 Coding picker components in vue.js for TIMEVA customizability.
Coding picker components in vue.js for TIMEVA customizability.
IndyDevDan
7 Coding a micro mode progress bar in vue.js on the balcony like a proper digital nomad.
Coding a micro mode progress bar in vue.js on the balcony like a proper digital nomad.
IndyDevDan
8 How to use dynamic css variables to create custom color themes for Timeva.
How to use dynamic css variables to create custom color themes for Timeva.
IndyDevDan
9 Building a minimal account page for my electron + vue.js app
Building a minimal account page for my electron + vue.js app
IndyDevDan
10 This is the final devlog
This is the final devlog
IndyDevDan
11 How to build and launch your next app in 30 days
How to build and launch your next app in 30 days
IndyDevDan
12 Learn Pinia in 10 MINUTES (Vue.js 3)
Learn Pinia in 10 MINUTES (Vue.js 3)
IndyDevDan
13 Learn Tailwind CSS by making a Cheatsheet | (30 Key CSS Properties)
Learn Tailwind CSS by making a Cheatsheet | (30 Key CSS Properties)
IndyDevDan
14 GitHub Copilot being hella useful when coding Electron + Vue.js app
GitHub Copilot being hella useful when coding Electron + Vue.js app
IndyDevDan
15 Vue Animations in 3 Lines of Code. (VueUse Motion)
Vue Animations in 3 Lines of Code. (VueUse Motion)
IndyDevDan
16 How to use VCCode Macros for Insane Developer Productivity (5x, 10x, 25x, 100x gains)
How to use VCCode Macros for Insane Developer Productivity (5x, 10x, 25x, 100x gains)
IndyDevDan
17 Is It Hype? Senior Engineer Learns GraphQL, Rages and Complains About Docs (RAW TAKE - Part 1)
Is It Hype? Senior Engineer Learns GraphQL, Rages and Complains About Docs (RAW TAKE - Part 1)
IndyDevDan
18 Is it Hype? Learn GraphQL by building an Express + GraphQL App (Part 2)
Is it Hype? Learn GraphQL by building an Express + GraphQL App (Part 2)
IndyDevDan
19 So you have an idea for an app. What's next? (3 Actions You Can Take Now)
So you have an idea for an app. What's next? (3 Actions You Can Take Now)
IndyDevDan
20 Coding Vue.js Components, Hooks, and Pinia State for Timeva v2
Coding Vue.js Components, Hooks, and Pinia State for Timeva v2
IndyDevDan
21 Coding Pomodoro Chaining (Vue.js, Electron, Pinia)
Coding Pomodoro Chaining (Vue.js, Electron, Pinia)
IndyDevDan
22 Programming Pomodoro Chaining PART 2 (Vue 3 Hooks Have Changed Me)
Programming Pomodoro Chaining PART 2 (Vue 3 Hooks Have Changed Me)
IndyDevDan
23 Chill Vue.js 3 Coding (Pom Chaining Part 3)
Chill Vue.js 3 Coding (Pom Chaining Part 3)
IndyDevDan
24 Senior Engineer Codes New App Feature With Vue.js, Copilot, Electron and TS.
Senior Engineer Codes New App Feature With Vue.js, Copilot, Electron and TS.
IndyDevDan
25 Is It Hype? Github Copilot (The Future of Programming)
Is It Hype? Github Copilot (The Future of Programming)
IndyDevDan
26 Achieving Balance as Engineers who want more from life (Raw Discussion)
Achieving Balance as Engineers who want more from life (Raw Discussion)
IndyDevDan
27 Indie Hackers Most Important Resource: RUNWAY
Indie Hackers Most Important Resource: RUNWAY
IndyDevDan
28 Timeva V2 - Customizable Productivity Timer For The Digital Age
Timeva V2 - Customizable Productivity Timer For The Digital Age
IndyDevDan
29 Notion API In 5 Minutes: Authentication (Python)
Notion API In 5 Minutes: Authentication (Python)
IndyDevDan
30 Notion API in 5 Minutes: Write (Python)
Notion API in 5 Minutes: Write (Python)
IndyDevDan
31 Notion API in 5 Minutes: Read (Python | Copilot)
Notion API in 5 Minutes: Read (Python | Copilot)
IndyDevDan
32 The AI Wave: 3 Years 3 Predictions 3 Actions (ChatGPT will be a Joke)
The AI Wave: 3 Years 3 Predictions 3 Actions (ChatGPT will be a Joke)
IndyDevDan
33 Notion API in 5 Minutes: How to Read Notion Databases in Python
Notion API in 5 Minutes: How to Read Notion Databases in Python
IndyDevDan
34 Notion API In 5 Minutes - Database Write (Add new rows in Python)
Notion API In 5 Minutes - Database Write (Add new rows in Python)
IndyDevDan
35 Automate Everything: Using The Notion API to automate tweets. Let’s Code
Automate Everything: Using The Notion API to automate tweets. Let’s Code
IndyDevDan
36 Going Serverless: Using Vercel Functions for our Notion Twitter App
Going Serverless: Using Vercel Functions for our Notion Twitter App
IndyDevDan
37 Serverless Cron Jobs: Automatically Run Your Serverless Functions With QStash And Vercel
Serverless Cron Jobs: Automatically Run Your Serverless Functions With QStash And Vercel
IndyDevDan
38 Let’s Break The Internet: ChatGPT API + Notion Infinite Tweet Generator
Let’s Break The Internet: ChatGPT API + Notion Infinite Tweet Generator
IndyDevDan
39 Survive the AI age: Managing AI generated content with Notion, Python, Vercel, and Cron.
Survive the AI age: Managing AI generated content with Notion, Python, Vercel, and Cron.
IndyDevDan
The AI Engineer: The Future of Programming
The AI Engineer: The Future of Programming
IndyDevDan
41 Master Disruption: How Top AI Engineers Will Dominate the GPT-X Era
Master Disruption: How Top AI Engineers Will Dominate the GPT-X Era
IndyDevDan
42 FFmpeg, GPT-4 & WhisperX: Convert Horizontal Videos to Vertical (97% AI)
FFmpeg, GPT-4 & WhisperX: Convert Horizontal Videos to Vertical (97% AI)
IndyDevDan
43 Why Use LangChain? A Blunt Overview for Advanced Engineers
Why Use LangChain? A Blunt Overview for Advanced Engineers
IndyDevDan
44 Nuxt + Vercel KV: Coding an AI Agent Network MVP (flow state devLog)
Nuxt + Vercel KV: Coding an AI Agent Network MVP (flow state devLog)
IndyDevDan
45 Build VueJS Components While You Sleep: First LLM Agent Network (V2)
Build VueJS Components While You Sleep: First LLM Agent Network (V2)
IndyDevDan
46 My Top 6 Modern Vue.js VSCode Snippets
My Top 6 Modern Vue.js VSCode Snippets
IndyDevDan
47 useComposable - Vue.js Composable Generator (GCP + Serverless + LLM)
useComposable - Vue.js Composable Generator (GCP + Serverless + LLM)
IndyDevDan
48 Let's Get Fired: Using AI Coding Assistant AIDER to do my Engineering Job
Let's Get Fired: Using AI Coding Assistant AIDER to do my Engineering Job
IndyDevDan
49 Writing code without coding - Browser TTS with AIDER (ASMR DEVLOG)
Writing code without coding - Browser TTS with AIDER (ASMR DEVLOG)
IndyDevDan
50 Learn Anything With AI: HTMX - FLASK - AIDER (asmr devlog)
Learn Anything With AI: HTMX - FLASK - AIDER (asmr devlog)
IndyDevDan
51 Advanced Prompt Engineering Techniques for FRONT-END Engineers
Advanced Prompt Engineering Techniques for FRONT-END Engineers
IndyDevDan
52 I'm DONE writing tests - using AI copilot AIDER to AUTOMATE testing.
I'm DONE writing tests - using AI copilot AIDER to AUTOMATE testing.
IndyDevDan
53 pip install YOUR-PACKAGE: Building your first python with Poetry, AIDER, and ChatGPT
pip install YOUR-PACKAGE: Building your first python with Poetry, AIDER, and ChatGPT
IndyDevDan
54 Git + AI = DIFFBRO: AI Coding the future of code reviews (python, aider, gpt-4)
Git + AI = DIFFBRO: AI Coding the future of code reviews (python, aider, gpt-4)
IndyDevDan
55 AI Devlog: Coding an AI powered, Code Review, CLI tool | Python, Aider,  ChatGPT
AI Devlog: Coding an AI powered, Code Review, CLI tool | Python, Aider, ChatGPT
IndyDevDan
56 Introducing DIFFBRO - Your AI powered PEER REVIEWS in one command
Introducing DIFFBRO - Your AI powered PEER REVIEWS in one command
IndyDevDan
57 ONE Word Prompts - 3 INSTANTLY useful Prompt Engineering Techniques
ONE Word Prompts - 3 INSTANTLY useful Prompt Engineering Techniques
IndyDevDan
58 The Javascript Ecosystem Killer: Using Bun, to Learn Bun (with AIDER)
The Javascript Ecosystem Killer: Using Bun, to Learn Bun (with AIDER)
IndyDevDan
59 "With this prompt, I learned Pytest in 12 minutes" - Learn ANYTHING with LLMs
"With this prompt, I learned Pytest in 12 minutes" - Learn ANYTHING with LLMs
IndyDevDan
60 Prompt Engineering an ENTIRE codebase: Postgres Data Analytics AI Agent
Prompt Engineering an ENTIRE codebase: Postgres Data Analytics AI Agent
IndyDevDan

This video teaches you how to build a personal terminal AI using ChatGPT, OpenAI, and Python, and how to automate tasks using AI. You will learn how to interact with the OpenAI chat completion endpoint, generate prompts for terminal auto-completion, and use AI to list files and convert images.

Key Takeaways
  1. Generate a prompt for terminal auto-completion
  2. Build a Python script to interact with the OpenAI chat completion endpoint
  3. Update the script to use the GPT 3.5 Turbo model
  4. Configure the script to run on startup and load the OpenAI key from a .m file
  5. Run Python script with OpenAI key
  6. Pass parameters to OpenAI endpoint
  7. Fix invalid requests
  8. Create bash function to run Python script from anywhere
  9. Use AI to list all Python files in the current directory
  10. Run LS command to list files
💡 The video showcases the potential of LLMs in programming and automation, demonstrating how to build a personal terminal AI that can automate tasks and interact with the user.

Related AI Lessons

Up next
5 Levels of AI Agents - From Simple LLM Calls to Multi-Agent Systems
Dave Ebbelaar (LLM Eng)
Watch →