Files
reflector/server/reflector-local/7min-SmolDeveloper/7min-SmolDeveloper-Transcript.txt
2023-07-26 15:13:46 +07:00

1 line
7.9 KiB
Plaintext

As an engineer, small developer is absolutely amazing and simultaneously terrifying. It is like having a junior engineer in your pocket. This goes beyond putting a prompt into JATGPT and having it help you code. This actually creates an entire project for you. And it's super easy to use. So I'm going to show you a project that I created in two minutes. Then I'm going to show you how to install it. Let's do it. So here's the prompt that I gave it. Write a Python project that takes a JATGPT API key in an M file. And then when the main script runs, ask the user for a prompt and then use the JATGPT 3.5 turbo API endpoint to get a response from JATGPT. Then it displays that response to the user and asks for another prompt. Make sure to include a requirements.txt file. Also make sure to use the open AI module. Here's an example of what the JATGPT API call should look like. And then I gave it an example straight from the JATGPT API docs. So I ran small developer on this prompt and it output an entire project for me. So we have the requirements file. We have the main file and we also have an M file. Now I'm definitely going to rotate this API key before publishing the video. So let's run it. Let's see what happens. Enter your prompt. Tell me a joke. There it is. Why couldn't the bicycle stand up by itself because it was too tired? Amazing. When was Bill Clinton president? Bill Clinton was the 42nd president of the United States and he served two terms from January 20th, 1993 to January 20th, 2001. So again, I created this entire project from a few lines of a prompt and it actually created all the files for me. So let me show you how to install it now. So this is the GitHub page. Small-AI slash developer. It has over 7,000 stars and nearly 500 forks and it's one of the trending GitHub repos right now. Human centric and coherent whole program synthesis, aka your own personal junior developer. So it gives a bunch of information about what it does, but let's actually do it. Now this is so easy to use and they give a few examples of incredible projects built from just a few prompts and you can get extremely detailed in these prompts. You can think of it like writing a spec and then you pass it off to a junior developer to write and chat, GPT writes it for you and creates all the files. So it's amazing. So the first thing we're going to do is come down around two thirds of the way through the page. We're going to grab this line, get clone and then the GitHub repo. We're going to copy that. So I have a new VS Code window open. I'm going to come up to the top right and click for a new terminal. Now once that new terminal opens, I'm going to CD to the desktop, hit enter and now I'm going to paste that line, get clone, GitHub.com, small-AI slash developer. Then I'm going to hit enter and then that's going to clone it to my desktop. From there, I'm going to CD into that folder. So now I'm in the folder. So the next thing I'm going to do is come up to the top left, click the Explorer icon and then click open folder. Then I'm going to open the developer folder. So there it is. That's the entire small developer project. I'm going to open up the terminal again by clicking the toggle panel in top right and while that's going, I'm going to rename the dot example dot nv to just dot nv. Then we're going to click on it and we're going to enter our open AI API key. Now you can use nthropic as well if you want, but I'm just going to stick with open AI. So if you don't have an open AI API key, head on over to open AI and just generate one. Then we're going to save this file. We're going to go down to main.py and this is the main file. So the nice thing about this project is it uses modal.com. I had actually not heard of modal.com, but essentially it's like a container like Docker. And it really takes away all of the complexities of managing module versions, Python versions, which I always stumble on. And according to a lot of the comments in my videos, a lot of you stumble on too. So this is a great solution to that. Now you don't need it, but it really makes it easier. So to use modal, go to modal.com, sign up for a new account. It says here that it's in private beta, but I was able to sign up no problem. So I don't think it's in private beta anymore. Then we're going to copy this right here, pip installed modal dash client. I'm going to switch back to my terminal and I'm going to paste it. So pip installed modal dash client. Enter. I already have it installed. But if you didn't, it would have installed it there. Now if you wanted to run this without modal, all you have to do is pip install dash our requirements dot txt and then run the file Python main no modal dot pi rather than main dot pi. But we're going to stick with using modal. And so the basic usage is right here. So we're going to grab just these first commands. And then I'm going to copy it. And it's modal run main dot pi dash dash prompt, switch back to visual studio code. And I'm going to paste that in. And so let's start with something really basic, write a Ruby script that counts to 100. And then I'm going to hit enter. Now the first time you do this modal is going to ask you to authenticate. And all you have to do is click the link, open up the website, log in and then switch back to terminal. And you're done. So it says it's going to create one file counts to 100 dot RB. And you can see here that it's actually using containers with modal. And it has a pretty nice UI for being strictly through the terminal. And there it is. It actually outputs the file name and what's in the file. But the cool part is it actually generates it for me. So if I come up here to the left and click this generated folder, click the drop down. There's the file. It just created count to 100 dot RB. So dev count to 100 for I and one to 100 puts I. That is correct. Now obviously this was a very simple example. But you can get quite complex. And the nice thing is, you don't actually have to put the entire prompt in the terminal. You can create this thing called prompt dot md and put your entire prompt in there. All right. So I have my little script here, modal run main dot pi dash dash prompt. And then I output the prompt. So I'm going to highlight that whole thing. I'm going to come to the terminal. I'm going to paste it. And then when it's finished, I hit enter. And now it's going to start creating that project. Now you could just create a dot md file and put your prompt in there instead of having to paste the entire prompt directly into terminal. Now while that's going, let me show you an example of what they've done. Now here's a really detailed spec of a chrome extension. Now I don't have access to and the topic. Claud yet. But as soon as I do, I'm going to test this out. But for now, you can see they basically created an entire detailed spec that can be passed to a junior developer. And in this case, the junior developer is chachy PT. And there it's done. App completed. So let's check it out. Now we're going to go to the generated folder. We're going to click it. And we're going to look inside. So we have the project route. We have our dot m file. We have the main dot pi file. And it looks like everything is correct. And we even have the requirements dot txt file. So for here, we need an API key. So I'm going to go grab that. I'm going to double click it. Paste and now I have the API key. And I'm going to save. Then I'm going to go to main dot pi. And I'm going to push play. And let's see if it works. Okay, so it loaded. Tell me a joke. Hit enter. And there it is. Why wouldn't the bicycle stand up by itself because it was too tired. Funny. Gaming the same exact joke as before. And that's it. We've created an entire project just with a prompt. And it creates the entire file structure, all of the code for it. And it's easily done. Give it a try. Let me know what you think. If you liked this video, please consider giving me a like and subscribe. And I'll see you in the next one.