diff --git a/.gitignore b/.gitignore index 52693cb..a2a16dc 100644 --- a/.gitignore +++ b/.gitignore @@ -162,4 +162,9 @@ cython_debug/ # ? SPACE FILES .env Spacefile -.space \ No newline at end of file +<<<<<<< HEAD +.space +cache +======= +.space +>>>>>>> 46b94ef52bcb30a222ea766dbdf1197d14331d44 diff --git a/.streamlit/config.toml b/.streamlit/config.toml index e5973c3..68ef30c 100644 --- a/.streamlit/config.toml +++ b/.streamlit/config.toml @@ -1,4 +1,4 @@ [theme] base="light" -primaryColor="#e02e2e" -textColor="#2e2f37" \ No newline at end of file +primaryColor="#d42fbc" +textColor="#000000" diff --git a/cache/cache_db.db b/cache/cache_db.db index a3f0cb9..53ea2be 100644 Binary files a/cache/cache_db.db and b/cache/cache_db.db differ diff --git a/data/charts/9e2c317e-480b-4e3d-b163-bef0c7a035b3.png b/data/charts/9e2c317e-480b-4e3d-b163-bef0c7a035b3.png new file mode 100644 index 0000000..5134c03 Binary files /dev/null and b/data/charts/9e2c317e-480b-4e3d-b163-bef0c7a035b3.png differ diff --git a/requirements.txt b/requirements.txt index c999c97..6f5a92c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,4 +8,4 @@ streamlit-option-menu streamlit-pandas-profiling plotly pymongo -tk \ No newline at end of file +tk diff --git a/src/modules/file/query.py b/src/modules/file/query.py index aa62d6d..911e7ee 100644 --- a/src/modules/file/query.py +++ b/src/modules/file/query.py @@ -35,7 +35,16 @@ def format_other(self, result): def query_csv_transformers(df, user_question, api): llm = OpenAI(api_token=openai_api_key) if api: - pandas_ai = SmartDataframe(df, config={"llm": llm}) + pandas_ai = SmartDataframe( + df, + config={ + "llm": llm, + "save_charts": True, + "save_charts_path": r"./data/charts", + }, + ) response = pandas_ai.chat(user_question) print(response) + if response == None: + return {"answer": None} return {"answer": response}