Metadata-Version: 2.4
Name: buywhere-llamaindex
Version: 0.1.0
Summary: LlamaIndex FunctionTool wrappers for the BuyWhere product catalog API
Project-URL: Homepage, https://buywhere.ai
Project-URL: Documentation, https://docs.buywhere.ai
Project-URL: Repository, https://github.com/buywhere-ai/buywhere-llamaindex
Author-email: BuyWhere <dev@buywhere.io>
License: MIT
Keywords: buywhere,ecommerce,llama-index,llamaindex,shopping,tools
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Requires-Dist: httpx>=0.24.0
Requires-Dist: llama-index-core>=0.10.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: tenacity>=8.0.0
Description-Content-Type: text/markdown

# buywhere-llamaindex

[LlamaIndex](https://www.llamaindex.ai/) `FunctionTool` wrappers for the [BuyWhere](https://buywhere.ai) product catalog API — search, compare, and track prices across 40+ retailers in Southeast Asia and the US.

## Installation

```bash
pip install buywhere-llamaindex
```

## Quick Start

```python
import os
from buywhere_llamaindex import create_buywhere_tools
from llama_index.core.agent import ReActAgent
from llama_index.llms.openai import OpenAI

os.environ["BUYWHERE_API_KEY"] = "bw_live_..."

tools = create_buywhere_tools()
agent = ReActAgent.from_tools(tools, llm=OpenAI(model="gpt-4o"), verbose=True)

response = agent.chat("Find me the cheapest wireless headphones in Singapore under SGD 100")
print(response)
```

## Available Tools

| Tool | Description |
|------|-------------|
| `search_products` | Full-text product search across all retailers |
| `get_product` | Fetch a single product by ID |
| `compare_prices` | Compare prices for a product across retailers |
| `find_deals` | Discover products with the biggest discounts |
| `browse_categories` | List all available product categories |
| `get_category_products` | Get products within a specific category |
| `get_deals` | Get the current deals feed |

## Configuration

Set the `BUYWHERE_API_KEY` environment variable, or pass it directly:

```python
tools = create_buywhere_tools(api_key="bw_live_...", base_url="https://api.buywhere.ai")
```

Get your API key at [buywhere.ai/api-keys](https://buywhere.ai/api-keys).
