mirror of
https://github.com/deepset-ai/haystack.git
synced 2025-07-23 17:00:41 +00:00

* remove duplicate imports * fix ungrouped-imports * Fix wrong-import-position * Fix unused-import * pyproject.toml * Working on wrong-import-order * Solve wrong-import-order * fix Pool import * Move open_search_index_to_document_store and elasticsearch_index_to_document_store in elasticsearch.py * remove Converter from modeling * Fix mypy issues on adaptive_model.py * create es_converter.py * remove converter import * change import path in tests * Restructure REST API to not rely on global vars from search.apy and improve tests * Fix openapi generator * Move variable initialization * Change type of FilterRequest.filters Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
28 lines
794 B
Python
28 lines
794 B
Python
import logging
|
|
|
|
import uvicorn
|
|
from rest_api.utils import get_app, get_pipelines
|
|
|
|
|
|
logging.basicConfig(format="%(asctime)s %(message)s", datefmt="%m/%d/%Y %I:%M:%S %p")
|
|
logger = logging.getLogger(__name__)
|
|
logging.getLogger("elasticsearch").setLevel(logging.WARNING)
|
|
logging.getLogger("haystack").setLevel(logging.INFO)
|
|
|
|
|
|
app = get_app()
|
|
pipelines = get_pipelines() # Unused here, called to init the pipelines early
|
|
|
|
|
|
logger.info("Open http://127.0.0.1:8000/docs to see Swagger API Documentation.")
|
|
logger.info(
|
|
"""
|
|
Or just try it out directly: curl --request POST --url 'http://127.0.0.1:8000/query'
|
|
-H "Content-Type: application/json" --data '{"query": "Who is the father of Arya Stark?"}'
|
|
"""
|
|
)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
uvicorn.run(app, host="0.0.0.0", port=8000)
|