Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 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:
|