Spaces:
Sleeping
Sleeping
williamagyapong
commited on
Update utility.py
Browse files- utility.py +2 -1
utility.py
CHANGED
@@ -12,6 +12,7 @@ from pandasai.llm import OpenAI
|
|
12 |
#from langchain.llms.sambanova import Sambaverse
|
13 |
#from langchain_community.llms.sambanova import Sambaverse
|
14 |
from langchain_community.chat_models.sambanova import ChatSambaNovaCloud
|
|
|
15 |
|
16 |
|
17 |
# Make API connection
|
@@ -282,7 +283,7 @@ def read_datalake(user_phone, user_question):
|
|
282 |
sales_df = pd.DataFrame(sales_list)
|
283 |
# return f"{inventory_df} \n\n {sales_df}"
|
284 |
|
285 |
-
lake = SmartDatalake([inventory_df, sales_df], config={"llm": llm, "response_parser": FlaskResponse, "enable_cache": False, "save_logs": False})
|
286 |
response = lake.chat(user_question)
|
287 |
|
288 |
return response
|
|
|
12 |
#from langchain.llms.sambanova import Sambaverse
|
13 |
#from langchain_community.llms.sambanova import Sambaverse
|
14 |
from langchain_community.chat_models.sambanova import ChatSambaNovaCloud
|
15 |
+
import ast
|
16 |
|
17 |
|
18 |
# Make API connection
|
|
|
283 |
sales_df = pd.DataFrame(sales_list)
|
284 |
# return f"{inventory_df} \n\n {sales_df}"
|
285 |
|
286 |
+
lake = SmartDatalake([inventory_df, sales_df], config={"llm": llm, "custom_whitelisted_dependencies":["ast"], "response_parser": FlaskResponse, "enable_cache": False, "save_logs": False})
|
287 |
response = lake.chat(user_question)
|
288 |
|
289 |
return response
|