Ionic LlamaIndex Agent Tool

Ionic LlamaIndex Tools Integration

We’re integrated deeply into LlamaIndex to enable quick integrations with Ionic. This tool will enable e-commerce for your agent, allowing your users to ask for product recommendations and purchase products through the agent chat interface.

Jupyter Notebook

Basic example integrating Ionic using LlamaIndex


First, install llama-index version of at least v0.10.

pip install llama-index-core==0.10.0 llama-index-llms-openai llama-index-agent-openai 

pip install ionic-api-sdk
pip install llama-index-tools-ionic-shopping


import os
import openai
from llama_index.agent.openai import OpenAIAgent
from llama_index.llms.openai import OpenAI

from import IonicShoppingToolSpec

openai.api_key = os.environ.get("OPENAI_API_KEY", "YOUR_API_KEY_HERE")

ionic_tool = IonicShoppingToolSpec().to_tool_list()

llm = OpenAI(model="gpt-3.5-turbo", api_key=openai_api_key)
agent = OpenAIAgent.from_tools(
    [*ionic_tool], llm=llm, verbose=True, 

Ionic API Key

Instantiate the IonicShoppingToolSpec with your api_key.

IonicShoppingToolSpec(api_key="<Your Ionic API Key>")