llama-index-integrations/tools/llama-index-tools-ionic-shopping/examples/ionic_shopping.ipynb
Ionic is a plug and play ecommerce marketplace for AI Assistants. By using Ionic, you are effortlessly providing your users with the ability to shop and transact directly within your agent, and you'll get a cut of the transaction.
This is a basic jupyter notebook demonstrating how to integrate the Ionic Shopping Tool. For more information on setting up your Agent with Ionic, see the Ionic documentation.
This Jupyter Notebook demonstrates how to use the Ionic tool with an Agent.
!pip install llama-index llama-hub ionic-api-sdk
import os
os.environ["OPENAI_API_KEY"] = "sk-api-key"
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI
from llama_hub.tools.ionic_shopping.base import IonicShoppingToolSpec
# optionally add you Ionic API Key
# IonicShoppingToolSpec(api_key="<my Ionic API Key>")
ionic_tool = IonicShoppingToolSpec().to_tool_list()
for tool in ionic_tool:
print(tool.metadata.name)
agent = FunctionAgent(
tools=ionic_tool,
llm=OpenAI(model="gpt-4.1"),
)
print(
await agent.run(
"I'm looking for a 5k monitor can you find me 3 options between $600 and $1000"
)
)