Spaces:
Sleeping
Sleeping
| from modules.shared import * | |
| from modules.query_api import * | |
| from modules.utils import * | |
| from llms.llama import * | |
| app = FastAPI() | |
| def greet_json(): | |
| return {"msg" : "Space under construction"} | |
| async def fetch_eurostat_dataflows(api_key: str = Depends(authenticate)) -> dict: | |
| output_file = f"{EUROSTAT_DATA_PATH}/dataflows.jsonl" | |
| return handle_fetch_and_parse(api_key, EUROSTAT_API_DATAFLOWS, output_file) | |
| async def fetch_istat_dataflows(api_key: str = Depends(authenticate)) -> dict: | |
| output_file = f"{ISTAT_DATA_PATH}/dataflows.jsonl" | |
| return handle_fetch_and_parse(api_key, ISTAT_API_DATAFLOWS, output_file) | |
| async def answer_user_query(prompt: str, api_key: str = Depends(authenticate)) -> dict: | |
| """ | |
| Endpoint to process a user's query using ISTAT data. | |
| Args: | |
| prompt (str): The user's question or prompt. | |
| api_key (str): API key for authentication, injected using the `authenticate` dependency. | |
| Returns: | |
| dict: Final data based on the user's query. | |
| """ | |
| return process_user_query(prompt) |