Spaces:
Sleeping
Sleeping
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -499,7 +499,8 @@ class BERTopicAgent:
|
|
| 499 |
|
| 500 |
def _update_downloads(self, text: str) -> None:
|
| 501 |
"""Scan agent text for downloadable artefact paths."""
|
| 502 |
-
|
|
|
|
| 503 |
new = list(filter(lambda p: p not in self._downloads, found))
|
| 504 |
self._downloads.extend(new)
|
| 505 |
|
|
|
|
| 499 |
|
| 500 |
def _update_downloads(self, text: str) -> None:
|
| 501 |
"""Scan agent text for downloadable artefact paths."""
|
| 502 |
+
# Added ?: to make it a non-capturing group
|
| 503 |
+
found = re.findall(r'artifacts/[\w_]+\.(?:json|csv|txt|npy|html)', text)
|
| 504 |
new = list(filter(lambda p: p not in self._downloads, found))
|
| 505 |
self._downloads.extend(new)
|
| 506 |
|