Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -169,7 +169,7 @@ def run_agent_chat(user_input: str, history: list):
|
|
169 |
url = user_input.split()[0] if user_input.startswith("http") else next((w for w in user_input.split() if w.startswith("http")), "")
|
170 |
request = user_input.replace(url, "").strip() or "Navigate to the URL and describe the page."
|
171 |
else:
|
172 |
-
url = "https://example.com"
|
173 |
request = user_input
|
174 |
|
175 |
search_request = f"Please go to {url}. {request}"
|
@@ -198,6 +198,8 @@ def run_agent_chat(user_input: str, history: list):
|
|
198 |
except:
|
199 |
logger.warning("Failed to close Chrome driver.")
|
200 |
|
201 |
-
# Launch GradioUI
|
202 |
if __name__ == "__main__":
|
203 |
-
|
|
|
|
|
|
169 |
url = user_input.split()[0] if user_input.startswith("http") else next((w for w in user_input.split() if w.startswith("http")), "")
|
170 |
request = user_input.replace(url, "").strip() or "Navigate to the URL and describe the page."
|
171 |
else:
|
172 |
+
url = "https://example.com"
|
173 |
request = user_input
|
174 |
|
175 |
search_request = f"Please go to {url}. {request}"
|
|
|
198 |
except:
|
199 |
logger.warning("Failed to close Chrome driver.")
|
200 |
|
201 |
+
# Launch GradioUI with explicit file_upload_folder
|
202 |
if __name__ == "__main__":
|
203 |
+
file_upload_folder = os.path.join(tempfile.gettempdir(), "web_agent_uploads")
|
204 |
+
os.makedirs(file_upload_folder, exist_ok=True)
|
205 |
+
GradioUI(agent=agent, chat_function=run_agent_chat, file_upload_folder=file_upload_folder).launch()
|