Building AI Agent-Based Applications: A Step-by-Step Guide
–
Building your own AI agent-based app is easier than ever. You can use a three-step process to create an app with the On Demand platform. This works for both skilled coders and those who don’t know how to code.
Start by going to the On Demand page. This is the home screen you will see. Navigate to the agent Marketplace. For this example, use the Amazon shopping agent plugin. Type "Amazon" to find the plugin and click “add.” This adds it to your Playground.
Next, go to the Playground. Here you will see the media knowledge plugin and model endpoints. This uses the On Demand GPT 4.o. You can switch models or create a custom one from Hugging Face if you like.
Click “add” to add the agent to the chat. You get a prompt example like “give us a list of Adidas shoes.” Change the currency to your location, such as GBP for the UK, and click run. The agent fetches data from Amazon in seconds.
To integrate this into your own app, click “get code.” Choose your programming language, like Python or JavaScript. Click “get code,” and it generates the necessary code in seconds. You need an API key and an external ID. Copy the code and save it to a text file.
In the On Demand platform, go to settings and locate the organization ID. Save this in a text document. Then get your API key. Create a new secret key, name it, and save it securely.
For this demo, use Streamlit, a simple Python framework. Paste your API key in the box. Run the application by opening the terminal and typing the command “streamlit run _app.py.” Another window will pop up. Paste both the API key and external user ID into the text boxes.
Click “create a chat session.” Submit a new query, and the Amazon agent will fetch prices and links for products in various regions. For example, set the price range, submit the query, and see products within that range. The status will show “completed,” and you get a list of products.
Click “go to link” to see the product page and order it. This platform and interface are very easy to use. Anyone can create AI agents quickly.