[VOD] Laravel AI SDK just dropped (part 2)
Chapters8
Host tests chat connectivity and lag, sets up image processing flow, and prepares to run the demo.
Nuno Maduro’s livestream reveals Laravel AI SDK’s capabilities, from image and audio generation to testing workflows and fallbacks, with hands-on demos and real-time feedback.
Summary
Nuno Maduro (nunomaduro) walks viewers through a lively, hands-on exploration of the Laravel AI SDK in Part 2. He shows live image manipulation via OpenAI-led prompts, including attaching a user photo to a Lamborghini and generating new images, while discussing practical UX considerations like progress bars and billing awareness. The stream dives into deep functionality: storing and reusing images, triggering image and audio generation, and even generating audio with controllable voices (including female, male, and pirate accents) using OpenAI-based tooling. He jokes about the ease of using the SDK, tweets about results, and continually tests the integration, emphasizing testing as a core benefit. The discussion expands to documentation breadth, covering attachments, embeddings, vector stores, failover strategies, and how to test agents end-to-end in Laravel. By the end, he gauges audience sentiment, invites feedback, and teases a potential follow-up video, underscoring the SDK’s potential to streamline AI features inside Laravel apps. This is a showcase of not just what the SDK can do, but how to think about production-readiness, UX, and maintainability when integrating AI services.
Key Takeaways
- OpenAI-based image generation in the Laravel AI SDK can attach a supplied image (e.g., nuno.png) and produce new compositions, with live demonstrations that include saving and referencing storage paths.
- Audio generation is supported with selectable voices (male/female, culturally nuanced accents like Portuguese) and can be stored as MP3s, enabling quick experiments with conversational AI in Laravel apps.
- The SDK supports queuing/gating for long-running AI tasks (e.g., image generation) via a cue/queue mechanism to avoid user wait times in interactive flows.
- Testing AI agents is a first-class citizen in the documentation, including unit-level testing of prompts and assertion of prompts being sent, and even handling database setup for tests.
- Failover capabilities are highlighted as a best practice, allowing AI flow to switch to alternative providers if a cloud service is down, improving reliability in production environments.
- The speaker emphasizes practical UX and observability (e.g., progress bars, billing awareness) and showcases how to document and share results (tweeting/demo clips) to communicate value quickly.
- The SDK’s breadth covers attachments, embeddings, and vector stores, showing how to integrate complex AI features with Laravel’s ecosystem while keeping maintainability in mind.
Who Is This For?
Essential viewing for Laravel developers who want to ship AI-powered features quickly—especially those building chatbots, content generation, or automated media pipelines within Laravel apps. It’s also valuable for teams evaluating AI SDKs for production-readiness and testing strategies.
Notable Quotes
"Taylor's SDK is so f good."
—Expresses enthusiasm about the SDK’s capabilities and ease of use.
"This is equivalent of an AI SDK on other languages. Good luck finding that."
—Highlights the SDK’s cross-language parity and perceived value.
"Ridiculously good, honestly. This is mindblowing."
—Conveys strong excitement about live experiments with AI features.
"Testing is insanely important. This AI SDK can be tested."
—Points to the documentation emphasis on testability.
Questions This Video Answers
- How does Laravel AISDK handle image generation with attached storage images?
- Can the Laravel AI SDK generate audio with different voices and accents, and how is it stored?
- What are best practices for failover when an AI provider goes down in Laravel apps?
- How do you test AI agents in Laravel to ensure prompts are correctly sent and responses validated?
- What are the practical steps to compare embeddings and implement vector stores in a Laravel project?
Laravel AISDKOpenAI integrationImage generationAudio generationEmbeddingsVector storesFailover strategiesAgent testingAttachments handlingTesting in Laravel
Full Transcript
Let's see. Let's see. [snorts] Okay, here we go. Link, link, link, link, link. I think we back, chat. I think we back. Let me know what do you think. Kind of need to open all the chats again because this is literally a part two now. So, what do you think? Okay, one. Oh, I'm Okay, I'm back. No lag now. Hopefully, there's no lag. like literally zero lag. If there is lag, I don't think we what we have to do. Write down in the comments, man, if the lag is okay. Much better. Zero lag. Perfect. [ __ ] We were about to literally use my own image on this Lamborghini and let's see how it goes.
Okay, Shad. What I was about to do, by the way, is from storage send my own image, ask for a lot of el developer on the Lambo and just pray it works. Okay, let's see. So, what I will do is go back here and just fet my image while everyone is connecting. No luck for now. We are so back, chat. We are so back. Okay, so I'm going to just copy my image just like that. Go to work again. Streams AI example. Go to storage and copy paste this. I'm going to call this nuno.png. Here we go.
And now I'm going to go to coding once again. So this will be I'm going to use here from path just like we did. Okay. So storage path. This will be nuno.png which is storage path. Here we go. Thank you PHPtorm. Okay. This should work. So, what I'm what I'm doing, by the way, what I'm doing right here is the following. Wait, what? What time is Wait, what what's happening with the chat all the way top? I don't see it. Oh, this is no good. Oh my god, the chat is broken, I think. Can you guys type something on the chat?
Like, whatever. Cuz I think uh the chat is literally broken. Yeah, it stopped working. That sucks, man. Oh, wait. What? The Twitch the Twitch chat is working. like you you guys can see only Twitch people on the way top but um but it seems to be stuck uh the the the YouTube one. Anyways, let's move forward chat. I can see the YouTube stuff. Okay, I can see the YouTube the YouTube stuff. W Nuno, thank you. Thank you. Thank you. Wait, what? It's working. It's back, baby. Cobra Kai is back, baby. Cobra Kai is back. Okay, we back.
We back. We fully back. Okay, so what I'm doing here, chat, let's focus. We need to focus, man. We need to focus. Okay. We need to focus all the way in. So, what we are doing here is delete the image.png. Okay. And what I will do is the following. I'm going to ask for an image of a guy on the attachment driving a Lambo. The attachment will be Nuno's picture, which is this one. This beautiful dude. Okay. Right here. And then I'm going to ask OpenAI to generate an image with that. We start as an image.
And it is done. Okay. Let's go all the way up. Bam. Bam. Boom. Type PBR8 image. Type enter and see how it goes. Okay, we know this is slow. We know this is slow. We know that this will take a little bit. Okay, that's what we know. But we can wait. Okay, you guys are so awesome. Literally 100 people just connected immediately to the part two. You guys are so cool. It will combine it automatically. Let's see. Let's see. I'm excited, man. I'm excited. [snorts] where progress bar. That's a good point. That's a good point.
Like having a progress bar. We absolutely need a progress bar. Okay. We absolutely need a progress bar right here. We don't see a progress bar. That's no good. But it's generating, man. Use the smartest model for the image. That's actually a very good point. I could have done that. Also a very good point is that I haven't checked my OpenAI bill. I'm using the the It's done, chat. It's done. [laughter] Oh my god. Do I look like this? Come on. I look a little bit better than this. No, don't you think? Come on. I look a little bit better than this.
Let's go. It is working, man. But I think I look a little bit better than this. Hopefully, right? Let me see with the Lambo like that. [laughter] So good, man. Can we just He tried it. Yeah, I know. I know. [laughter] Can we just realize how [ __ ] ridiculous is this API? [snorts] Honestly, we need to tweet about this. We need to tweet about this stuff. Okay, we need to tweet about this about this stuff. This is [ __ ] ridiculous easy to just manipulate images with Taylor's SDK. We need to tweet about this ASAP. So, I'm going to just do this.
I'm going to just do this in open Twitter because we need to we need to speak about this. We need to be open about this stuff. Okay. So, let's go all the way up. Uh, bada boom, bada boom, and let's post something. I'm going to go this. Bam, bam, boom. Go to chat. Improve the screenshot. Okay, just do that. Boom. So, uh, Taylor is SDK is so good. Okay, this is what I think. Honestly, what I think. So, let's just tweet this because people do need to know about this stuff. This is a must a must know.
Okay, everyone needs to know about this. Let's just do this. Save it. Bam. Taylor SDK is so f good. Okay, here we go. Chat, this is a tweet. Okay, we need to tweet about this stuff. Important. Important. This is equivalent of an AISDK on other languages. Good luck finding that, dude. I'm going to just tell you this, okay? Good luck finding that. So, this is what we have. And we are not done. This is half of the documentation, chat. So, we have been streaming for two hours. And this is half of the documentation. Can you guys see on the on right here?
This is half of the documentation. This is how [ __ ] ridiculous big this package actually is. Okay, half of the documentation. There is so much stuff we can do about this. images can be generated with a high quality landscape and of course you can also ask for the smartest model uh on the agent as we have seen. Okay, we can also ask for the smartest model. Okay, so we can attach whatever we want to when prompting for an image. So potentially here you can upload a PDF and ask for changes for example. Uh you can upload a file or a text file and do that.
You can equally send a request given file to uh the image prompt if you want to. Okay. Uh we can store the given image publicly if we want to as well. This is kind of expected. We can cue the generation of image. Super important by the way. Meaning that this is something you actually want to do. We just saw that the generating of image takes kind of 30 seconds I think. So you kind of want to cue that. So we do that through Q job and we don't have to kind of make the user wait.
Okay. We also want to do that. We have audio. Oh my god, this is getting [ __ ] ridiculous, man. Honestly, we have audio chat. Do you want to guys want to see the audio? Type w audio if you want to see some audio. Oh my god. I want to see some audio, man. Oh my god. Let's just type here generate audio. [snorts] This is becoming ridiculous right now. We have audio. What do you mean audio? How can I play audio? Okay, I'm going to just generate audio and see then what I can do with this. Can I store it?
Yes, I can store it as MP3. Oh my [laughter] Oh my god. Oh my god. So, this will be audio generated and stored as audio whatever. This is so [ __ ] ridiculous. Honestly, ridiculously good, you know, like you know, just surprising. I'm going to just type here so good. Oh my god. Okay, so I'm going to ask for that generation. Audio is imported. Save it as that. Generate. Okay, hopefully this will work with OpenAI. We have no idea. Let's see how it goes. Generate image is not defined. Of course, this is not generate image. This is generate audio.
Okay. Audio. So, we ask for the generation of audio. That was too fast. Almost too fast. And I don't believe it. Okay. Almost too fast that I don't believe it. Something have probably went wrong. Shad. I'm going to open the audio. You guys let me know if you can hear it. Okay. You guys let me know if you can hear it. I think you can hear it, but you guys let me know. Okay. So, this is an audio. So, how can you want to open it? Uh, I'm going to do something a little bit different.
I'm going to go here. I'm going to open the storage.md app private. And I have the audio indeed. I'm going to open it. So good. OMG. Did you guys heard it? Wait, what? So good. OMG. This is This is getting ridiculous at this point. Jesus [ __ ] what the actual [ __ ] what the this is honestly like can we tweak oh someone is saying uh can you change the person who is speaking that's actually a good point [snorts] I don't think I don't think that is a method for that. There is a method call it female in method call it male.
Are you serious right now? No [ __ ] way. No way. Oh, you guys change scene. I know. I know. I'm getting like too excited. I was I was trying to find like a way of making the um the generating of uh you know of the audio to be used as a different person like a different person and apparently there's methods for female and male. Are you guys seeing this? What is voice? I don't even know. Like this is getting ridiculous. All right, let's use this now. So good. OMG. Okay, this is the female version. So good.
OMG. Wait, what does that worked? Well, it's like the female version of that audio. Okay. Uh, so we have female, we have male. What is the default though? The default is like just you don't specify it. Maybe. Perhaps it might be. Try the voice method. What do you want me to put on it though? Cuz the voice method Charlie is asking for like a shrink. Wait, what is alloy? Specify a specific voice for the generated audio. And what do I put on the voice thing chat? Can you make a conversation bot where the conversation is with you?
I think so. Yes. But what do I put on the voice, man? So, this is this is using open AI. Hopefully, there is like Well, let's actually try this one. the alloy thing. Okay, so I'm going to do this again. How much token is required to do all of this stuff? I have no idea. I'm still yet to find my my open AI bill. Nuno voice. That would be cool. All right, I'm going to just put alloy and see how it, you know, I have no idea what will end up happening right now. All right, it did work.
So good. OMG. All right, that was the result. So I think all I is a different voice. So the theory around this is that you can specify different voices and that's it. Really cool stuff. Honestly, really cool stuff. The voice thing is from 11 Labs. Are you I don't think it is from 11 Labs, dude. Look at this. If I go to AI.php, it's using OpenAI for audio. Okay, someone is saying um use o n ipsson x which I have no idea what it is. Let's do that. And someone is saying say it like a pirate.
Oh, there is instructions. Wait, wait a second. Instructions. So, we can actually prompt AI to also like do this in a different manner for example. Okay, so clear the terminal. Uh let's actually equally clear the audio PMPP3. Okay. Generate audio once again. So, this will be said like a pirate, I think. So, good. OMG. It's a different voice for sure. So, that worked. But, uh, it doesn't look like a pirate. Use Portuguese accent. Oh, that's a good point. Let's type here something in Portuguese, like aent. Okay, this is Portuguese. Okay, chat. and uh say it with a Portuguese accent.
Let's see how it goes. Now, I'm going to remove this audio once again. Generate audio. Okay, done. That was not bad. Although that doesn't look like Portuguese. That looks like Portuguese from Brazil. Well, actually, if I ask for Portuguese from Portugal, he might just do it. Very cool stuff, by the way. Very interesting stuff here. This is ridiculous. Ridiculous stuff, honestly. Let's see this one. That was top-notch. This is top-notch, by the way. Top-notch stuff here. Okay, very interesting, by the way. This is mindblowing. Okay, this is mindblowing. Okay, so let's actually, you know, just do another tweet because this is mind-blowing.
Jesus [ __ ] Christ. Interesting here. Okay, very interesting stuff. Let's tweet about this chat. We need to do it. Let's go to profile. Let's do this post. Bam. Just screenshot this. Oh my god. Audio, too. Here we go. Much better. Let's see the open AI bill for real. Dude, [laughter] I cannot wait to see my open AI bill. That's a good point. Uh Taylor uh Taylor is AISDK on audio Taylor. Here we go. Wait, what? Taylor. Oh, here we go. This is the one. Okay, let's go back. What else we have more? Like, literally, we are half through it.
Like, this is [ __ ] ridiculous. We are half through the thing. Like, we can also do transcriptions, which is literally taking that audio MP3 and just it's audio to text basically. So, you can in theory translate they give an MP3 to actual text as well. That's something you guys can do too. Okay. I don't know if you guys want to test this one real quick, but in theory, if I go all the way top and I import this and then I just do this. So, we have an audio saying so good, right? So, in theory, if I do this storage path, uh that would be private or app private audio.mpp3.
So if I do this in theory the transcript will contain so good. Okay. So again I'm reading I am reading from the given audio and just outputting that information. Okay. This is what I think will happen is that the AI will display generate transcript. Okay. Transcript. Okay. Generate transcript. Let's do this. So this in theory will make the AI read the MP3 file and just print. So good. in theory. Oh yeah, Nuno is Oh, so good. So the audio was still Nuno is a meaning that if I read the audio, here we go. And the output of the transcript was just topnotch.
That was in Portuguese, by the way. This is insane. This is absolutely insane. What do you guys think? WSDK hardcore. What do you think about this? Very cool stuff. Very very cool stuff. Okay. Wow. I am, you know, I knew this would be good, but like honestly [snorts] amazing stuff right here. This is a big W. I know. And we are out through it. This is the most ridiculous stuff I've ever ever seen, honestly. [snorts] What else we have? Jesus Christ. So much stuff. Embeddings, which is literally what we talked about. Okay, embeddings is what we talked about already.
Okay, what we talked about multiple times. Embeddings for the win. Query embeddings. Of course, we can do this as well. We talked about this already. What else we have? Let's go all the way down. By the way, embeddings is actually a big thing. Would be actually a great demo to have on a video, but I think we're going to bypass that one because it's kind of difficult to explain to people what this is about. Ranking. You guys just taught me that re-ranking is about reorganizing embeddings in terms of scoring and everything. We talked about that.
What else we have? We have files. So, this we have seen already. Uh uh use stored file in conversations. This is the attachment stuff. Yep. Yep. Yep. Yep. Vector stores. This is a huge deal by the way, but I think I'm going to skip that one today if you guys don't mind. Failover. Wow. This is mind-blowing by the way. This is also insanely important. If you are developing an application that relies on AI, you cannot simply stop working with cloud code is down. Okay. And cloud code is down. I don't know how many guy how many times cloud is cloud code is down for you guys, but for me it's down 20 times a day.
I actually receive an email every single time cloud code is down in terms of API and it's literally 20 times a day. So you want to just have fallovers. Well, you know, you want to have a way of AI to fall back to other providers if something is down. So if OpenAI is down, it will rely now on entropic after that. All right. Nice. Nice chat. Don't forget go all the way down. Click like on this video and subscribe this channel. If you want to see this number going up, okay, if you want to see this number going up, just click on the subscribe button.
Okay, testing [ __ ] This is [ __ ] important. Okay, how do you want to test your agents? Of course. Okay, so we all know how testing is important. Testing is insanely important. In theory, using testing is [ __ ] easy with this thing. Okay, so the only thing we have to do, let's actually remove all of this stuff. Okay, so we have our personal assistant right here. What we can do is create a test for it. Okay, so what I will do here is go to agents. I'm going to go into the unit level, I think, and I'm going to create a new directory with the name AI.
Okay. And then I'm going to have another directory with the name agents. And this agent will be called or this test will be called personal assistant test. Even though I wouldn't do it at this level, I think. Yeah, I wouldn't do at this level. I would very likely [clears throat] apologize. I would very likely to have a console command. Here we go. This is what I want to do exactly. So, I want to do something a little bit different, which is I want to use the artisan facade. I want to call the command with a name, let's see, with a command name example.
Okay, just like that. And we have a response. Okay. And now in theory what I can do is the following. I can have potentially this just like that. Okay. Uh let's actually give the prompt like that because I don't know how exactly how I can test Laravel prompts even though it should be easy but I'm going to not do it right now. Let's receive the prompt as an argument real quick. So prompt equals to this argument prompt just like that. fetching a user, getting a prompt, and then I'm going to assert that the prompt got sent to the user.
Okay. So, in theory, what I have to do is the following. I just have to go to the documentation, and I have to type uh personal assistant fake. Here we go. I can do this all the way top just like that. Okay. Why are you blushing and why your nose is too red? Because I'm a little bit sick, dude. As usual. [snorts] Boom, boom, boom, boom, boom. Cloth code, the open source AI. Oh, yeah, baby. How about video? That's a good question actually. Does it support video though? Oh, it does not support video. I don't think it supports video.
No, not at the minute. Not at the minute. Can I use that in Arduino? Well, in theory, you can. Yes. [snorts] Does it support open router? Like, everyone is talking about open router. What the [ __ ] is open router, chat? I have no idea. It does support open router. Yes. But why open router is important? Can someone just type on the chat why open router is important? I don't know what it is and I never use it I think. So just type on the comments why that is important. Okay let's import this uh all the way top as usual and do the same thing with personal assistant just like that.
And what we can do is type personal assistant assert prompt and I want to assert that what the editor was like today. Okay. And what I will do is call this artisan command with prompt. What is the other today? And I'm going to assert the got prompt. So this should literally be the test. I'm going to type vendor bean past feature and then example test. And this should work. Okay, we have one failure because there is no such table users. Uh why is that? No such table users. I'm using Oh, I'm not using refresh database.
That's why. So let's use refresh database. So now it's working. But there is no user um to be fetched here as first. So what we can do is type user model factory create. So this will create a user for the test. Meaning that this will retrieve a user model. Okay, meaning that now this should work. And here we go. We have a successful test suite. This is insane. Okay, this is how easy is to test agents by the way. So if you have a job or potentially HTTP layer that uses a personal assistant, an agent, you can continue to test that HTTP layer, but you need to fake that agent so it doesn't actually prompt AI.
And then you just assert that he got prompt. So it really just works. [snorts] Okay, really really cool stuff. I don't know many of you are fans of testing. If you are not, you should. And this is important. Okay, important that this AI SDK is can be tested. So I think like this entire documentation is about literally how to test um this agents. Okay, I think like the entire documentation all the way down will be how do you test that an attachment got sent? How do you test that an image got generated will be just the full story about it.
So I thought we were at the at the middle but I think we are going literally to the end of the documentation. So the entire end is about documentation basically about testing um which is something important but I don't think we need to demo. So this is Laravel AISDK. So I want you guys to give me a classification from zero to 100. What is your ranking about this AI SDK? Mine is 100% 100. I think this is absolutely mind-blowing. Super happy about this and I cannot happy. I cannot wait to actually build something with this.
Okay, I cannot wait. What do you guys think? 10,000 Fion. [laughter] Oh my god, I think this is insane. Okay, this is insane. 110. Thank you. Thank you. Thank you. This is absolutely dope indeed. Absolutely dope. Easy. 100 WDK for the win. I agree. Jesus Christ. One penta. [laughter and gasps] Oh my god, this was so dope. Sh. I kne I knew this ASDK would be just dope, but uh this was fantastic. chat. I want you guys before leave, I want you guys to go all the way down and obviously click like on this video and subscribe my channel if you can.
I think this is fantastic. I'm going to very likely to generate a video out of this stream because this was absolutely dope and I love when my videos capture some of the, you know, some of the genuine reactions while using this and I can only do that when I'm doing this for the first time. So, absolutely dope. I loved it. Uh, thank you so much for being on that side. We had a bunch of people watching today's live stream which was awesome. Make sure to click on the like button before leaving. Uh, subscribe my channel as well.
Let's rate someone on Twitch as usual to see who we have online at the minute. But that was dope. Absolutely dope, chat. Absolutely dope. 99,000. See you later on the meeting. Oh, we have a meeting today. [ __ ] That's a problem. [laughter] Okay, let's rate someone chat. Let's rate someone on Twitch as usual. Okay, D stream, that was awesome. Uh, who do we have online? Okay, there is like literally uh someone doing react I think. So, I'm going to just spray this person and if you guys want to do some react today um you are going to enjoy this one.
Okay, chat. Love you all. Catch you guys tomorrow. I think I think I'm going to stream tomorrow. So, catch you guys tomorrow. Love you all. See you tomorrow. Peace out. Bada. Heat. Heat. N.
More from nunomaduro
Get daily recaps from
nunomaduro
AI-powered summaries delivered to your inbox. Save hours every week while staying fully informed.









