Spaces:
Sleeping
Sleeping
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +12 -12
src/streamlit_app.py
CHANGED
|
@@ -88,18 +88,18 @@ def render_tool_message(tool_message: ToolMessage):
|
|
| 88 |
st.info(f"🧰 Using tool :- {tool_name or ''}")
|
| 89 |
|
| 90 |
# Check if this is a file-related tool
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
|
| 104 |
|
| 105 |
def loadchats():
|
|
|
|
| 88 |
st.info(f"🧰 Using tool :- {tool_name or ''}")
|
| 89 |
|
| 90 |
# Check if this is a file-related tool
|
| 91 |
+
if any(k in tool_name for k in file_related_keywords):
|
| 92 |
+
# Find all files in TEMP_DIR (freshly modified ones)
|
| 93 |
+
created_files = sorted(
|
| 94 |
+
[os.path.join(TEMP_DIR, f) for f in os.listdir(TEMP_DIR)],
|
| 95 |
+
key=lambda x: os.path.getmtime(x),
|
| 96 |
+
reverse=True,
|
| 97 |
+
)
|
| 98 |
+
if created_files:
|
| 99 |
+
st.success("📄 File(s) created by tool:")
|
| 100 |
+
for file_path in created_files[:3]:
|
| 101 |
+
if("chatbot" not in file_path):
|
| 102 |
+
show_file(file_path)
|
| 103 |
|
| 104 |
|
| 105 |
def loadchats():
|