Metadata-Version: 2.1
Name: oracle-of-ammon
Version: 0.3.0
Summary: CLI tool for creating Search APIs.
Home-page: https://kmcleste.github.io/oracle-of-ammon/
License: MIT
Keywords: fastapi,haystack,search,faq,typer
Author: Kyle McLester
Author-email: kyle.mclester@gmail.com
Requires-Python: >=3.8.1,<3.11
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Dist: aiofiles (>=22.1.0,<23.0.0)
Requires-Dist: bs4 (>=0.0.1,<0.0.2)
Requires-Dist: farm-haystack (>=1.13.0,<2.0.0)
Requires-Dist: fastapi (>=0.88.0,<0.89.0)
Requires-Dist: markdown (>=3.2.1,<3.4)
Requires-Dist: openpyxl (>=3.0.10,<4.0.0)
Requires-Dist: pandas (>=1.5.2,<2.0.0)
Requires-Dist: pdf2image (>=1.16.2,<2.0.0)
Requires-Dist: psutil (>=5.9.4,<6.0.0)
Requires-Dist: pynvml (>=11.4.1,<12.0.0)
Requires-Dist: pytesseract (>=0.3.10,<0.4.0)
Requires-Dist: python-frontmatter (>=1.0.0,<2.0.0)
Requires-Dist: python-magic (>=0.4.27,<0.5.0)
Requires-Dist: python-multipart (>=0.0.5,<0.0.6)
Requires-Dist: requests (>=2.28.1,<3.0.0)
Requires-Dist: typer[all] (>=0.7.0,<0.8.0)
Requires-Dist: types-psutil (>=5.9.5.6,<6.0.0.0)
Requires-Dist: uvicorn (>=0.20.0,<0.21.0)
Project-URL: Repository, https://github.com/kmcleste/oracle-of-ammon
Description-Content-Type: text/markdown

# Oracle of Ammon

[![PyPI version shield](https://img.shields.io/pypi/v/oracle-of-ammon?color=blue&style=flat-square)](https://pypi.org/project/oracle-of-ammon/)
[![Python version shield](https://img.shields.io/pypi/pyversions/oracle-of-ammon?color=blue&style=flat-square)](https://pypi.org/project/oracle-of-ammon/)
[![MIT License](https://img.shields.io/github/license/kmcleste/oracle-of-ammon?style=flat-square)](https://github.com/kmcleste/oracle-of-ammon/blob/main/LICENSE)

A simple CLI tool for creating Search APIs.

## Installation

Creating a virtual environment is highly recommended. To do so, run:

```bash
python3 -m venv .venv
source .venv/bin/activate
```

Once your environment is active, simply install the package with:

```bash
pip install oracle-of-ammon
```

## Usage

To get started, checkout the help menu:

```bash
oracle-of-ammon --help
```

[![Image of oracle-of-ammon cli help documentaiton](https://github.com/kmcleste/oracle-of-ammon/blob/main/images/oracle-of-ammon-help.gif?raw=true)](https://github.com/faressoft/terminalizer)

Here, you will see we currently have two options: **summon** and **locust**.

### Summon

By default, Summon is configured to initialize an empty search service on port 8000. The API framework used is [FastAPI](https://fastapi.tiangolo.com/) and the underlying search engine is built on [Haystack](https://docs.haystack.deepset.ai/). If you would like to initialize the search service with documents upon startup, provide a filepath with the `--path` option. Once the service has been initialized, you can view the API docs at [http://127.0.0.1:8000/docs](http://127.0.0.1:8000/docs). A static version of the swagger documentation can also be found [here](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/kmcleste/oracle-of-ammon/main/openapi.json#/).

| Option        | Type | Default         | Description                                                                                                                         |
| ------------- | ---- | --------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| --path        | TEXT | None            | Filepath used to pre-index document store.                                                                                          |
| --sheet-name  | TEXT | None            | If using an excel file, select which sheet(s) to load. If none provided, all sheets will be loaded. Expects a comma-separated list. |
| --title       | TEXT | Oracle of Ammon | API documentation title.                                                                                                            |
| --index       | TEXT | document        | Default index name.                                                                                                                 |
| --faq         | BOOL | TRUE            | Selector for content preloaded into document store.                                                                                 |

Supported Filetypes:

- FAQ: CSV, TSV, JSON, XLSX, TXT
- Semantic: TXT

See the [`data`](https://github.com/kmcleste/oracle-of-ammon/tree/main/oracle_of_ammon/data) directory for examples of accepted files.

[![Oracle of Ammon CLI - Summon](https://github.com/kmcleste/oracle-of-ammon/blob/main/images/oracle-of-ammon-summon.gif?raw=true)](https://github.com/faressoft/terminalizer)

### Locust

[Locust](https://locust.io/) is an open source tool for load testing. You're able to swarm your system with millions of simultaneous users -- recording service performance and other metrics. By default, Locust will start on port 8089. To start a new load test, simply enter the number of users you want to simulate, their spawn rate, and the host address to swarm.

[![Image of locust config](https://github.com/kmcleste/oracle-of-ammon/blob/main/images/locust-config.png?raw=true)](https://locust.io)]

## Coming Eventually 👀

- ~~Semantic search~~
- ~~Document search~~
- ~~Document summarization~~
- Document ranking
- ~~Multiple index support~~
- Annotations/Feedback
- Fine tuning
- Additional locust endpoints
- Dynamic Locust config
- Custom pipelines
- Dedicated docs wiki

