robertselvam commited on
Commit
2f20fc7
1 Parent(s): 5a56fdd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -135,16 +135,16 @@ class ChatDocumentQA:
135
  file_extension = os.path.splitext(file_path)[1]
136
 
137
  if 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
- # AzureOpenAI(azure_deployment = "ChatGPT"),
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:
 
135
  file_extension = os.path.splitext(file_path)[1]
136
 
137
  if 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
+ AzureOpenAI(azure_deployment = "ChatGPT"),
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: