Create and set the environment variables based on .env.template
. You will need
to create a .env
file.
flask run -h 0.0.0.0 --debug
Alternatively, set the FINESSE_BACKEND_DEBUG_MODE
environment variable to
True
and run:
python run.py
Create and set the environment variables based on .env.template
. You will need
to create a .env
file.
Build the container:
docker build -t finesse-backend .
Deploy the container locally:
docker run -p 5000:5000 -e PORT=5000 --env-file .env finesse-backend
You can also use docker-compose
to run the API with the client. The client is
the web interface that makes use of the API and is available at https://github.com/ai-cfia/finesse-frontend.
To run the API and the client together, you can use the following command:
docker-compose up --build
You can then access the client at http://localhost
.
curl -X POST http://localhost:5000/search/static --data '{"query": "is e.coli a virus or bacteria?"}' -H "Content-Type: application/json"
curl -X POST "http://localhost:5000/search/azure?top=10&skip=0" --data '{"query": "is e.coli a virus or bacteria?"}' -H "Content-Type: application/json"
top
(optional): Number of search results to return.skip
(optional): Number of search results to skip from the start.
curl -X POST "http://localhost:5000/search/llamaindex?top=10" --data '{"query": "is e.coli a virus or bacteria?"}' -H "Content-Type: application/json"
top
(optional): Number of search results to return.
- id: The unique identifier for each document.
- url: The URL of the document, which should point to inspection.canada.ca.
- score: Represents the search score, indicating the relevance of the document to the query.
- title: The title of the document.
- content: The main content or body of the document.
- subtitle: The title or titles extracted from the snippet.
- last_updated: The last modified date of the document.