williamagyapong commited on
Commit
beab094
·
verified ·
1 Parent(s): 4e3a5dc

Update utility.py

Browse files
Files changed (1) hide show
  1. 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