robertselvam commited on
Commit
e76b8cd
·
1 Parent(s): 5b0b42e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -5
app.py CHANGED
@@ -135,11 +135,16 @@ class ChatDocumentQA:
135
  vectorstore = self._create_vector_store_from_text_chunks(text_chunks)
136
  return "file uploaded", {"knowledge_base": vectorstore}
137
  elif file_extension == '.csv':
138
- agent = self.create_agent(file_path)
139
- tools = self.get_agent_tools(agent)
140
- memory,tools,prompt = self.create_memory_for_csv_qa(tools)
141
- agent_chain = self.create_agent_chain_for_csv_qa(memory,tools,prompt)
142
-
 
 
 
 
 
143
  return "file uploaded", {"knowledge_base": agent_chain}
144
 
145
  else:
 
135
  vectorstore = self._create_vector_store_from_text_chunks(text_chunks)
136
  return "file uploaded", {"knowledge_base": vectorstore}
137
  elif file_extension == '.csv':
138
+ # agent = self.create_agent(file_path)
139
+ # tools = self.get_agent_tools(agent)
140
+ # memory,tools,prompt = self.create_memory_for_csv_qa(tools)
141
+ # agent_chain = self.create_agent_chain_for_csv_qa(memory,tools,prompt)
142
+ agent_chain = create_csv_agent(
143
+ OpenAI(temperature=0),
144
+ file_path,
145
+ verbose=True,
146
+ agent_type=AgentType.ZERO_SHOT_REACT_DESCRIPTION,
147
+ )
148
  return "file uploaded", {"knowledge_base": agent_chain}
149
 
150
  else: