Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -240,6 +240,16 @@ with st.container():
|
|
| 240 |
}
|
| 241 |
|
| 242 |
result = graph.invoke(state_input, config=config)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 243 |
|
| 244 |
# If it’s a code response, append it as-is
|
| 245 |
# if result.get("code"):
|
|
@@ -253,14 +263,14 @@ with st.container():
|
|
| 253 |
# elif result.get("messages"):
|
| 254 |
# st.session_state.chat_history.append(result["messages"][-1])
|
| 255 |
|
| 256 |
-
if result.get("code"):
|
| 257 |
-
|
| 258 |
|
| 259 |
-
if result.get("explanation"):
|
| 260 |
-
|
| 261 |
|
| 262 |
-
if result.get("messages"):
|
| 263 |
-
|
| 264 |
|
| 265 |
|
| 266 |
st.rerun()
|
|
|
|
| 240 |
}
|
| 241 |
|
| 242 |
result = graph.invoke(state_input, config=config)
|
| 243 |
+
|
| 244 |
+
if result.get("code"):
|
| 245 |
+
st.session_state.chat_history.append(AIMessage(content=result["code"]))
|
| 246 |
+
|
| 247 |
+
if result.get("explanation"):
|
| 248 |
+
st.session_state.chat_history.append(AIMessage(content=result["explanation"]))
|
| 249 |
+
|
| 250 |
+
if result.get("messages"):
|
| 251 |
+
st.session_state.chat_history.append(result["messages"][-1])
|
| 252 |
+
|
| 253 |
|
| 254 |
# If it’s a code response, append it as-is
|
| 255 |
# if result.get("code"):
|
|
|
|
| 263 |
# elif result.get("messages"):
|
| 264 |
# st.session_state.chat_history.append(result["messages"][-1])
|
| 265 |
|
| 266 |
+
# if result.get("code"):
|
| 267 |
+
# st.session_state.chat_history.append(AIMessage(content=result["code"]))
|
| 268 |
|
| 269 |
+
# if result.get("explanation"):
|
| 270 |
+
# st.session_state.chat_history.append(AIMessage(content="**🔍 Code Explanation:**\n\n" + result["explanation"]))
|
| 271 |
|
| 272 |
+
# if result.get("messages"):
|
| 273 |
+
# st.session_state.chat_history.append(result["messages"][-1])
|
| 274 |
|
| 275 |
|
| 276 |
st.rerun()
|