Skip to content

Latest commit

 

History

History
60 lines (42 loc) · 1.12 KB

README.md

File metadata and controls

60 lines (42 loc) · 1.12 KB

rag-api

  • This is a simple Python/Flask service that can ingest text, convert it into embeddings, and store the embeddings within memory.
  • Given a query, a relevant sentence is then returned.

Setup

  • Create a virtual environment
virtualenv env
  • Activate the virtual environment
source env/bin/activate
  • Install the dependencies in requirements.txt
pip install -r requirements.txt

Usage

  • Run the server by using the following command:
python3 server.py
curl --location 'http://127.0.0.1:5000/ingest' \
--header 'Content-Type: application/json' \
--data '[
{
"id": 1,
"text": "This is a test sentence."
}
]'
curl --location 'http://127.0.0.1:5000/query?text=test%20query'

Unit Tests

Unit tests can be found in tests.py
To run tests, use:

python3 tests.py