LlamaIndex integration for BuyWhere — search products, discover deals, and browse categories through the BuyWhere product catalog API
Project description
llama-index-tools-buywhere
BuyWhere product catalog tools for LlamaIndex agents. Search products, discover deals, and browse categories across 1.5M+ products from Shopee, Lazada, Amazon, Walmart, and 20+ platforms.
pip install llama-index-tools-buywhere
Quick Start
import os
from llama_index.tools.buywhere import BuyWhereToolSpec
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI
os.environ["BUYWHERE_API_KEY"] = "bw_live_xxx"
tool_spec = BuyWhereToolSpec()
agent = FunctionAgent(
tools=tool_spec.to_tool_list(),
llm=OpenAI(model="gpt-4o"),
system_prompt="You are a helpful shopping assistant.",
)
response = agent.run("find wireless headphones under SGD 50 in Singapore")
print(response)
Tools
| Tool | Description |
|---|---|
search_products |
Full-text search with price, category, merchant, and region filters |
get_deals |
Discounted products sorted by discount percentage |
list_categories |
Browse available product categories with counts |
API
BuyWhereToolSpec
| Method | Returns | Description |
|---|---|---|
to_tool_list() |
list[FunctionTool] |
All 3 tools as LlamaIndex FunctionTool instances |
to_tool_dict() |
dict[str, FunctionTool] |
Tools keyed by name |
Constructor:
BuyWhereToolSpec(
api_key: str | None = None, # API key or BUYWHERE_API_KEY env var
base_url: str = "https://api.buywhere.ai",
timeout: float = 30.0,
)
Error Handling
| Exception | When |
|---|---|
BuyWhereAuthError |
Missing, invalid, or expired API key |
BuyWhereNetworkError |
Timeout, connection failure, or HTTP error |
BuyWhereRateLimitError |
Rate limit exceeded (HTTP 429) |
All tool methods return list[Document] — LlamaIndex Document objects with structured metadata for downstream processing.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llama_index_tools_buywhere-0.1.0.tar.gz.
File metadata
- Download URL: llama_index_tools_buywhere-0.1.0.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95147aeebd0374d0ededa328cd82c464cbfbaeadd60fca89a6b7813b99387c84
|
|
| MD5 |
039c62afb28d4750d77c08b55334e877
|
|
| BLAKE2b-256 |
edb93a65969233b2015e6ec4eff22679e5873061253567e2a8565b3ad30ba4c8
|
File details
Details for the file llama_index_tools_buywhere-0.1.0-py3-none-any.whl.
File metadata
- Download URL: llama_index_tools_buywhere-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9cdbe988a1d998fd548d11282e630d4f9029b955eec3de7e350278a65eb07e6d
|
|
| MD5 |
c6fcfab6be449a343e0b740053e63a77
|
|
| BLAKE2b-256 |
77d075ebbe559fb2e9537d1678f7f821b7caa116c7ca3b6a3c7936cdc747665a
|