Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -125,10 +125,23 @@ def main():
|
|
125 |
b64 = base64.b64encode(html.encode()).decode()
|
126 |
st.markdown(f'<a href="data:file/html;base64,{b64}" download="ui.html">Download HTML</a>', unsafe_allow_html=True)
|
127 |
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
st.subheader("π Performance")
|
133 |
st.write(f"β±οΈ Total Time: {total_time:.2f} seconds")
|
134 |
st.write(f"π Iterations: {final_state['iteration']}")
|
|
|
125 |
b64 = base64.b64encode(html.encode()).decode()
|
126 |
st.markdown(f'<a href="data:file/html;base64,{b64}" download="ui.html">Download HTML</a>', unsafe_allow_html=True)
|
127 |
|
128 |
+
# Communication History
|
129 |
+
st.subheader("π§ Agent Communication Log")
|
130 |
+
history_text = ""
|
131 |
+
for msg in final_state["messages"]:
|
132 |
+
role = msg["role"].replace("_", " ").title()
|
133 |
+
content = msg["content"]
|
134 |
+
history_text += f"---\n{role}:\n{content}\n\n"
|
135 |
+
st.text_area("Agent Dialogue", value=history_text, height=300)
|
136 |
+
|
137 |
+
# Download Chat Log
|
138 |
+
b64_hist = base64.b64encode(history_text.encode()).decode()
|
139 |
+
st.markdown(
|
140 |
+
f'<a href="data:file/txt;base64,{b64_hist}" download="agent_communication.txt" '
|
141 |
+
'style="padding: 0.4em 1em; background: #4CAF50; color: white; border-radius: 0.3em; text-decoration: none;">'
|
142 |
+
'π₯ Download Communication Log</a>',
|
143 |
+
unsafe_allow_html=True
|
144 |
+
)
|
145 |
st.subheader("π Performance")
|
146 |
st.write(f"β±οΈ Total Time: {total_time:.2f} seconds")
|
147 |
st.write(f"π Iterations: {final_state['iteration']}")
|