Metadata-Version: 2.4
Name: eigen-client
Version: 1.0.4
Summary: EigenDB's Official Python API
Author-email: Ryan Awad <ryanawad@yahoo.com>
Project-URL: Homepage, https://github.com/Eigen-DB/eigen-db/tree/main/libs/eigen-py
Project-URL: Issues, https://github.com/Eigen-DB/eigen-db/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: requests==2.29.0
Requires-Dist: pytest==8.4.1
Requires-Dist: tiktoken==0.11.0
Requires-Dist: ollama==0.5.3
Requires-Dist: openai==1.101.0

# EigenDB's Official Python SDK 🐍

![](https://img.shields.io/badge/Python-3776AB?style=flat&logo=python&logoColor=white) [![](https://img.shields.io/pypi/v/eigen-client)](https://pypi.org/project/eigen-client/)

![OpenAI](https://img.shields.io/badge/OpenAI-fff?style=for-the-badge&logo=openai&logoColor=black) [![Ollama](https://img.shields.io/badge/Ollama-fff?logo=ollama&style=for-the-badge&logoColor=000)](#)

A Python client for EigenDB's REST API. 

### Installation

```bash
pip install eigen-client
```

### Example usage:
```py
import os
from eigen_client.client import Client
from eigen_client.data_types import Document

client = Client(
    url="http://localhost:8080",
    api_key="eigendb-***",
)

index = client.create_index_from_model(
    index_name="food-facts",
    model_name="text-embedding-3-small",
    model_provider="openai",
    model_provider_api_key="your openai api key..."
)

documents = [
    Document(id=1, data="Fresh herbs boost flavor.", metadata={"recipe_id": "123"}),
    Document(id=2, data="Slow simmer blends soup.", metadata={"recipe_id": "456"}),
    Document(id=3, data="Homemade bread smells great.", metadata={"recipe_id": "789"}),
    Document(id=4, data="Grilled veggies taste sweeter.", metadata={"recipe_id": "987"}),
    Document(id=5, data="Cast iron sears steak well.", metadata={"recipe_id": "654"})
]

index.upsert_docs(documents)

results = index.search_docs(
    string="Baking",
    k=3
)

print(results)
```

### Documentation

Documentation can be found [here](https://eigendb.mintlify.app/sdks/python)!

Made with ❤️ by developers, for developers.
