Spaces:
Sleeping
Sleeping
Ishanpardeshi
commited on
Commit
•
2a2de58
1
Parent(s):
7759639
Update app.py
Browse files
app.py
CHANGED
@@ -91,13 +91,13 @@ class tools:
|
|
91 |
class AgentLoader:
|
92 |
|
93 |
def csvReaderAgent(path):
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
return
|
101 |
|
102 |
def fileReaderAgent(path):
|
103 |
FileReader = Agent(
|
@@ -182,7 +182,7 @@ def process_file(file, query, expected_output):
|
|
182 |
agent = AgentLoader.fileReaderAgent(path)
|
183 |
elif path.endswith(".csv"):
|
184 |
agent = AgentLoader.csvReaderAgent(path)
|
185 |
-
results =
|
186 |
else:
|
187 |
return 'File NOT supported'
|
188 |
|
|
|
91 |
class AgentLoader:
|
92 |
|
93 |
def csvReaderAgent(path):
|
94 |
+
agent = create_csv_agent(
|
95 |
+
llm,
|
96 |
+
path,
|
97 |
+
verbose=True,
|
98 |
+
agent_type=AgentType.ZERO_SHOT_REACT_DESCRIPTION
|
99 |
+
)
|
100 |
+
return agent
|
101 |
|
102 |
def fileReaderAgent(path):
|
103 |
FileReader = Agent(
|
|
|
182 |
agent = AgentLoader.fileReaderAgent(path)
|
183 |
elif path.endswith(".csv"):
|
184 |
agent = AgentLoader.csvReaderAgent(path)
|
185 |
+
results = agent.run(query)
|
186 |
else:
|
187 |
return 'File NOT supported'
|
188 |
|