Update main.py
Browse files
main.py
CHANGED
@@ -55,7 +55,7 @@ def create_agent(filename: str):
|
|
55 |
df = pd.read_csv(filename)
|
56 |
|
57 |
# Create a Pandas DataFrame agent.
|
58 |
-
return
|
59 |
|
60 |
def query_agent(agent, query):
|
61 |
"""
|
@@ -155,7 +155,7 @@ async def set_starters():
|
|
155 |
async def on_message(message: cl.Message):
|
156 |
await cl.Message(f"> SURVEYIA").send()
|
157 |
agent = create_agent("./public/ExpeCFA_LP_CAA_7-5-2024.csv")
|
158 |
-
result = agent.
|
159 |
# Query the agent.
|
160 |
#response = query_agent(agent=agent, query=message.content)
|
161 |
# Decode the response.
|
|
|
55 |
df = pd.read_csv(filename)
|
56 |
|
57 |
# Create a Pandas DataFrame agent.
|
58 |
+
return create_csv_agent(llm, df, verbose=False, allow_dangerous_code=True, handle_parsing_errors=True, agent_type=AgentType.OPENAI_FUNCTIONS)
|
59 |
|
60 |
def query_agent(agent, query):
|
61 |
"""
|
|
|
155 |
async def on_message(message: cl.Message):
|
156 |
await cl.Message(f"> SURVEYIA").send()
|
157 |
agent = create_agent("./public/ExpeCFA_LP_CAA_7-5-2024.csv")
|
158 |
+
result = agent.run(message.content)
|
159 |
# Query the agent.
|
160 |
#response = query_agent(agent=agent, query=message.content)
|
161 |
# Decode the response.
|