Update app.py
Browse files
app.py
CHANGED
@@ -62,11 +62,11 @@ if prompt := st.chat_input("Ask Palm 2 anything..."):
|
|
62 |
st.markdown(response['content'])
|
63 |
|
64 |
if response['code']:
|
65 |
-
if st.button('Run Code'):
|
66 |
# with st.status("Running code..."):
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
# Add assistant response to chat history
|
72 |
st.session_state.messages.append({"role": "assistant", "content": response['content']})
|
|
|
62 |
st.markdown(response['content'])
|
63 |
|
64 |
if response['code']:
|
65 |
+
# if st.button('Run Code'):
|
66 |
# with st.status("Running code..."):
|
67 |
+
try:
|
68 |
+
exec(response['code'])
|
69 |
+
except Exception as e:
|
70 |
+
st.write(f"ERROR {e}...")
|
71 |
# Add assistant response to chat history
|
72 |
st.session_state.messages.append({"role": "assistant", "content": response['content']})
|