# How To Build AI Agents (For Beginners) OnDemand AI Agent Tutorial

## Метаданные

- **Канал:** TheAIGRID
- **YouTube:** https://www.youtube.com/watch?v=2SHH1T_uPqU
- **Дата:** 17.08.2024
- **Длительность:** 8:32
- **Просмотры:** 123,050
- **Источник:** https://ekstraktznaniy.ru/video/14122

## Описание

First 100 users get $250 off https://app.on-demand.io/auth/signup?refCode=AIGRID 

00:00 - Introduction to the AI agent-based application tutorial
00:19 - Navigating to the agent marketplace
00:44 - Adding the Amazon Shopping Agent plugin
01:03 - Testing the agent in the playground
02:35 - Generating code for the application
03:36 - Getting API key and organization ID
04:36 - Setting up the development environment (using Streamlit)
05:35 - Running the application
06:52 - Submitting a query in the custom application
07:45 - Demonstration of results and conclusion

Prepare for AGI with me - https://www.skool.com/postagiprepardness 
🐤 Follow Me on Twitter https://twitter.com/TheAiGrid
🌐 Checkout My website - https://theaigrid.com/


Links From Todays Video:
Code - https://github.com/amrrs/amazon_agent?tab=readme-ov-file

Welcome to my channel where i bring you the latest breakthroughs in AI. From deep learning to robotics, i cover it all. My videos offer valuable insights and perspectives

## Транскрипт

### Introduction to the AI agent-based application tutorial []

so welcome back to the AI Grid in today's online tutorial I'm going to be showing you guys the fastest way to build your own AI agent-based application I'm going to walk you through a simple three-step process to create your own application powered by AI agents and this is going to be using the on demand platform so

### Navigating to the agent marketplace [0:19]

whether you're a software engineer or just someone who doesn't really know how to code this tutorial is going to be absolutely from the absolute Basics all the way up to the advanced integration so this tutorial is absolutely for everyone so you can see right here that I am currently on this on demand page you can see that this is the home screen that you're going to see now what you want to do is you want to navigate to of

### Adding the Amazon Shopping Agent plugin [0:44]

course the agent Marketplace and then of course you want to be able to find your agent that you want to use for this video what I'm going to be using is the Amazon shopping agent plugin so for example I just type in Amazon there are a variety of different agents that you could use but you can see right here that this is the Amazon shopping plugin

### Testing the agent in the playground [1:03]

and once we click add this is now added to our Playground now what we now need to do is we go to the playground now that we are here we now moved on to the next step so in this chat agent you can see right here we've got a media knowledge plugin the model endpoints this is just going to use on demand GPT 40 then of course you know you can switch out the models if you do want to you could always have your own custom model from hugging face if you would like to as well what you're going to want to do is then of course add the agent right here so just click add then you can see that on the top right hand corner it says plugin added successfully now that agent is in our chat you can see that it gives us a prompt example so we can see that the question is give us a list of adid Das shoes whose price are between these two ranges so what I'm going to do is I'm going to switch this from AED to GBP because I'm currently in the UK so I'm going to switch thatat to GBP and then I'm going to click run now currently this is working with the Amazon agent in order to execute and of course you can see within just literally seconds my Amazon agent has fetched every single shoe that exists on the UK version of the Amazon website and you can see that it's managed to get me this data immediately now these links actually do work I would click the Amazon link but I don't want to show you guys all of the things that I've been buying but just trust me this looks absolutely incredible so you can see that these links are complet valid and what was also cool about this is that it manages to give you the right link for

### Generating code for the application [2:35]

your specified location so all I had to do was put GBP and it managed to give me the data for that and what I could do is I could do USD as well so for example I'm going to show you guys USD and I'm going to put USD here and then you can see if I click run it's now going to be showing me the things that are in the United States for example just wait for the code to run and then you can see it's also got every single location so this is worldwide and it shows you that these agents work really well now what I'm going to do is I'm going to show you guys if you actually want to integrate this into your own application this is super easy and I'm someone who doesn't have the biggest technical background and this literally only took 3 minutes to do that was remarkably simple so after testing the agent in the playground all you need to do is you need to just click here click get code now essentially you need to choose your desired programming language now for those of you who are going to be watching this tutorial you can use Python so I'm just going to type python

### Getting API key and organization ID [3:36]

not like that but python of course you can use JavaScript but I'm going to click Python and then this generates all of the necessary code for you so I'm going to click get code now you can see right here it says code generated successfully this took around 3 seconds to do and this is all of the key data that we're going to need in order to have our own application so you can see right here that in order to actually make this code work we're going to need two things so what we're going to need is an API key and of course an external ID you can see that there are two things right here that we need to replace the API key replace the external user ID so we now need to do is of course copy this code and save this code to our computer so I'm just going to click copy here and I'm going to save this to a simple text file so now within the ond demand platform your next step is very simple you need to scroll down click settings then on your organization tab you need to just locate the organization ID on the right hand side

### Setting up the development environment (using Streamlit) [4:36]

then just copy this and then of course save this in a text document because you'll need this later then of course you'll need to get your API key you can see here on the API Keys management area just click API Keys then of course click create new secret key of course I'm going to delete this one but we'll just name this Amazon but of course I'll agent key 3 so with this key what you're going to want to do is Click create secret key then of course make sure that you copy this key and actually paste it down into a notepad or a Word document because you're not going to be able to visualize this key once again so just make sure that you save this key securely once you've saved both your API key and your organization ID in a little notepad then you're free to move on to the next step so in this current demo I'm currently using something that is called streamlet which is a simple python framework for creating web applications you can integrate this code into any platform whether it's react gradio or even an Android app so what you now need to do

### Running the application [5:35]

before you want to run this is simply to make sure that you've pasted your external your API key in this box here and those are the last steps that you're going to need to do once you've done that you'll just now need to run this application so for this application which is buil which is built with the streamlit platform all I'm going to do now is just simply open up the terminal then I'm going to hit this command which is called streamlit run _ app. py and remember there is a link to this entire demo in the description below so if you are struggling with any of this just simply copy the code copy The Prompt and debug with GPT 40 and within three or two prompts you're going to immediately understand this even if you are a complete beginner so now once you have this all you need to do right here is to just hit streamlit run odore app. py and then once you do this another window will pop up and if this doesn't work like I said before just make sure that your direct Dory where you've downloaded the file and extracted it is actually the same as this one on the left so for example just click this right here then just copy this and then just paste that enter chat GPT and it will actually give you the command with this in order to run this completely easily once that happens now you'll see this popup and then just click enter again it will probably be your first time running streamlit and then once that happens you'll then see this screen pop up here

### Submitting a query in the custom application [6:52]

now this is where we once again going to need our API key and of course our external user ID we'll just paste both of those into those two text boxes and then of course we'll be ready to create our chat session so once we're here we'll just click create a chat session and since I've already done this what I'm going to do is I'm going to submit a new query so it will open up a chat session and then what you'll be able to do is use your Amazon file agent and that to just immediately get prices from different regions and of course links for different products so for example I can change the prices here and I can set 2020 to £40 and I can click submit query and then of course I can simply see what products are immediately available now you'll see that it is running in the top right hand side you can see that it says running right there and of course it says submitting query now you can see right here that it shows me all of the Adidas shoes priced between £20 and £40

### Demonstration of results and conclusion [7:45]

you see right here it gave me a list of like just an amazing list honestly I'm a little bit speechless but a list of 35 different products and you can see it says status here completed so that was a completely quick way to absolutely make AI agents and this is by far the easiest thing I've used and I've used a tons and tons of different programs but you can see right here if we just click not even copy but go to link you're going to see that immediately we get this web page of this product that we can easily order and easily buy now of course it's not how you know most people use these agents but however you do want to use these agents it's completely up to you but I find this platform and this user interface completely easy to use if you do have any questions don't forget to leave a comment down below and thank you to on demand for sponsoring today's video they've built an amazing platform
