Spaces:
Sleeping
Sleeping
arithescientist
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -72,12 +72,9 @@ def process_input():
|
|
72 |
# Append user message to history
|
73 |
st.session_state.history.append({"role": "user", "content": user_prompt})
|
74 |
|
75 |
-
# Use the agent to get the response
|
76 |
with st.spinner("Processing..."):
|
77 |
-
response = agent_executor(user_prompt
|
78 |
-
|
79 |
-
# Log the response keys for debugging
|
80 |
-
logging.info(f"Response keys: {response.keys()}")
|
81 |
|
82 |
# Extract the final answer and the data from intermediate steps
|
83 |
final_answer = response['output']
|
@@ -95,7 +92,6 @@ def process_input():
|
|
95 |
|
96 |
# Convert the result to a DataFrame for better formatting
|
97 |
if sql_result:
|
98 |
-
# Adjust the column names based on your query
|
99 |
df_result = pd.DataFrame(sql_result)
|
100 |
sql_result_formatted = df_result.to_markdown(index=False)
|
101 |
else:
|
@@ -133,6 +129,9 @@ def process_input():
|
|
133 |
# Reset user input
|
134 |
st.session_state['user_input'] = ''
|
135 |
|
|
|
|
|
|
|
136 |
# Step 5: Display conversation history
|
137 |
for message in st.session_state.history:
|
138 |
if message['role'] == 'user':
|
|
|
72 |
# Append user message to history
|
73 |
st.session_state.history.append({"role": "user", "content": user_prompt})
|
74 |
|
75 |
+
# Use the agent to get the response WITHOUT 'return_intermediate_steps'
|
76 |
with st.spinner("Processing..."):
|
77 |
+
response = agent_executor(user_prompt) # Removed 'return_intermediate_steps' here
|
|
|
|
|
|
|
78 |
|
79 |
# Extract the final answer and the data from intermediate steps
|
80 |
final_answer = response['output']
|
|
|
92 |
|
93 |
# Convert the result to a DataFrame for better formatting
|
94 |
if sql_result:
|
|
|
95 |
df_result = pd.DataFrame(sql_result)
|
96 |
sql_result_formatted = df_result.to_markdown(index=False)
|
97 |
else:
|
|
|
129 |
# Reset user input
|
130 |
st.session_state['user_input'] = ''
|
131 |
|
132 |
+
|
133 |
+
|
134 |
+
|
135 |
# Step 5: Display conversation history
|
136 |
for message in st.session_state.history:
|
137 |
if message['role'] == 'user':
|