Lesson Description
The "Testing" Lesson is part of the full, AI Agents Fundamentals, v2 course featured in this preview video. Here's what you'd learn in this lesson:
Scott demonstrates setting up a safe testing environment, creating a new directory, and configuring environment variables. He also addresses potential CLI errors and shows how to troubleshoot them.
Transcript from the "Testing" Lesson
[00:00:00]
>> Scott Moss:All right, we got all that set up. We shouldn't have to do anything here in our run function because it just imports that tools object that we just added tools to, so that should be fine. In that case, I'm going to try to build this, see if I get some TypeScript errors. I do, because I forgot to put the .ts. What file was that? Index? Yup. .ts, there we go.
[00:00:34]
Got another one here and tools. Oh, here too. Oh, there we go, export, there we go. Cool, built that. Gonna install this globally, so I get the AGI command. Great. And then what you might want to do, which would be helpful. If you just, can you go away? If you just cd into like another directory, since we're going to be like messing with files and stuff, you probably don't want to do that in the directory in which your code is in, because you might mess that up.
[00:01:08]
That's why I made it a CLI so you can point it to any directory. So if you want to play, I mean, go for it. You can just, you know, change it with Git, but like, just to be safe, I'm just going to, you know, let me go back here and make a directory right quick and call it, you know, fun, ENV or whatever. And I was going to cd into there. So now I'm inside of my fun ENV.
[00:01:37]
Then I can just open up my AGI. Or, Laminar object with the project rookie, oh, did I forget to add my .env in here? No, it's in there. What do you want? Let's see. It's funny how that just threw an error now and it never threw an error before. Let's see. Does it have to be? It's a different name. It's a different name. Yeah, that's me. On this branch, I must have called it a different name.
[00:02:19]
Then my .env file. There we go. Cool. Laminar object to project. Did I not just change that? Laminar API key. One sec. That looks right to me. OK, well, I am just for the sake of not caring about that right now and not getting stuck on it. Is it because it's not being run in the project directory? In the what directory? Because you're not running AGI like in the project directory is the key, is it trying to reference the.
[00:02:52]
You know what, I didn't consider that. I didn't think that that would matter since I bundled it as a CLI, but I guess that could be the case. Let's see. Well, that name was actually different. That was a different name, but let's see. I don't think that's the case, but I could be wrong. OK, maybe that was the case, yeah, I don't know, yeah. It was a wrong name though, so it was both.
[00:03:22]
Good catch. Yeah, so I guess environment available won't work. Yeah, I wonder why that's the case. Let me, I'm curious now. Hold on. Yeah, anyway, oh wait, you know what? I think I know why. It's because of how I'm using it with TSX I believe. Yeah, right here. Yeah, OK, cool. That's why, that's my fault. OK, so now I can say. I don't know what tools or what can you help me with?
[00:04:05]
Here you go. OK. Thank you. I didn't need all that. Says he can do programming, creative work, translation stuff. My knowledge is up to date as far as June 2024. That's how long they work on this after training. They just released this model not too long ago, this year, and the cutoff date was last year, last summer. So just think about that, how much safety that goes into it after and they're still not that safe.
[00:04:35]
So, can you use the files? I can use the files. I can list files and folders, read file contents. You know, write overwrite files. OK, show me the directory structure of the current directory. Yes, I do have a blinking UI bug here, so if you're seeing that that's where it came from. And then, yes, there it is, here's a directory structure at the current path, so, and you, if you saw it, it quickly showed the list file tool that was being executed in yellow, so it ran that file, so that totally works, then I can say.
[00:05:25]
Show me the contents of the tsconfig.json. Oh. I'll put generate, check the stream for errors. OK, let's just start over. I might have blown up the context window, so. In the context of the tsconfig. Wow, yeah. Cool, it listed the files first, it read the file. And yeah, it's showing me the tsconfig. Cool.
Learn Straight from the Experts Who Shape the Modern Web
- 250+In-depth Courses
- Industry Leading Experts
- 24Learning Paths
- Live Interactive Workshops