From a4d67cf09b909ff80c9ebfa924407eec98df862b Mon Sep 17 00:00:00 2001 From: BachNgoH Date: Wed, 19 Jun 2024 12:10:36 +0700 Subject: [PATCH] doc: adding more detailed docs --- README.md | 18 ++++++++++++++++++ app.py | 1 - src/tools/paper_search_tool.py | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1446aee..9946366 100644 --- a/README.md +++ b/README.md @@ -83,6 +83,24 @@ python src/paper_ingest.py **Starting the Application** +Before starting your application, you need to fill in some evironment variables. Create a `.env` file and fill in these: + +```bash +# LLM Provider +OPENAI_API_KEY= +GROQ_API_KEY= # (Optional) +GOOGLE_API_KEY= + +# For Searching +SERPER_API_KEY= + +# Email Sending +SENDGRID_API_KEY= # (Optional) +CHAINLIT_AUTH_SECRET= + +``` +You can create th `CHAINLIT_AUTH_SECRET` by running the command `chainlit create-secret`. + Once everything is ready, you can launch the application by running: ```bash diff --git a/app.py b/app.py index bd5d5fa..347630c 100644 --- a/app.py +++ b/app.py @@ -1,4 +1,3 @@ -import sys from fastapi import FastAPI from dotenv import load_dotenv from api.controller import router diff --git a/src/tools/paper_search_tool.py b/src/tools/paper_search_tool.py index 1317015..482b30a 100644 --- a/src/tools/paper_search_tool.py +++ b/src/tools/paper_search_tool.py @@ -83,7 +83,7 @@ def retrieve_paper(query_str: str, start_date: str = None, end_date: str = None) operator=FilterOperator.GTE, value=datetime.strptime(start_date, "%Y-%m-%d").timestamp())) - if end_date is not None: + if end_date is not None and end_date != '': filters.filters.append( MetadataFilter( key="date",