Bläddra i källkod

For security. (#3642)

### What problem does this PR solve?


### Type of change

- [x] Performance Improvement
tags/v0.14.1
Kevin Hu 11 månader sedan
förälder
incheckning
3df1663e4f
Inget konto är kopplat till bidragsgivarens mejladress
1 ändrade filer med 2 tillägg och 1 borttagningar
  1. 2
    1
      agent/component/crawler.py

+ 2
- 1
agent/component/crawler.py Visa fil

@@ -17,6 +17,7 @@ from abc import ABC
import asyncio
from crawl4ai import AsyncWebCrawler
from agent.component.base import ComponentBase, ComponentParamBase
from api.utils.web_utils import is_valid_url


class CrawlerParam(ComponentParamBase):
@@ -39,7 +40,7 @@ class Crawler(ComponentBase, ABC):
def _run(self, history, **kwargs):
ans = self.get_input()
ans = " - ".join(ans["content"]) if "content" in ans else ""
if not ans:
if not is_valid_url(ans):
return Crawler.be_output("")
try:
result = asyncio.run(self.get_web(ans))

Laddar…
Avbryt
Spara