devchavda11 commited on
Commit
0e1b27a
·
verified ·
1 Parent(s): fcd4add

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. 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
- 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():
 
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():