Spaces:
Sleeping
Sleeping
Upload 228 files
Browse filescorreccion del get
- backend/.DS_Store +0 -0
- workflow.py +9 -2
backend/.DS_Store
ADDED
|
Binary file (6.15 kB). View file
|
|
|
workflow.py
CHANGED
|
@@ -59,12 +59,19 @@ class ScrapeNode(ActionNode):
|
|
| 59 |
client = self.get_client()
|
| 60 |
# Requisito: Timeout de 60s por nodo
|
| 61 |
response = await asyncio.wait_for(
|
| 62 |
-
asyncio.to_thread(client.scrape, url,
|
| 63 |
timeout=self.timeout
|
| 64 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
return {
|
| 66 |
**state,
|
| 67 |
-
"result":
|
| 68 |
"error": None
|
| 69 |
}
|
| 70 |
except asyncio.TimeoutError:
|
|
|
|
| 59 |
client = self.get_client()
|
| 60 |
# Requisito: Timeout de 60s por nodo
|
| 61 |
response = await asyncio.wait_for(
|
| 62 |
+
asyncio.to_thread(client.scrape, url, params={"formats": ["markdown"]}),
|
| 63 |
timeout=self.timeout
|
| 64 |
)
|
| 65 |
+
|
| 66 |
+
# Soporte dual: diccionario (SDK antiguo/API) u objeto (SDK nuevo)
|
| 67 |
+
if isinstance(response, dict):
|
| 68 |
+
markdown_content = response.get("markdown", "")
|
| 69 |
+
else:
|
| 70 |
+
markdown_content = getattr(response, "markdown", "") or ""
|
| 71 |
+
|
| 72 |
return {
|
| 73 |
**state,
|
| 74 |
+
"result": markdown_content,
|
| 75 |
"error": None
|
| 76 |
}
|
| 77 |
except asyncio.TimeoutError:
|