mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-16 11:57:51 +01:00
fix: firecrawl import
This commit is contained in:
@@ -4,7 +4,6 @@ from typing import Optional, List
|
|||||||
from open_webui.retrieval.web.main import SearchResult, get_filtered_results
|
from open_webui.retrieval.web.main import SearchResult, get_filtered_results
|
||||||
from open_webui.env import SRC_LOG_LEVELS
|
from open_webui.env import SRC_LOG_LEVELS
|
||||||
|
|
||||||
from firecrawl import Firecrawl
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
log.setLevel(SRC_LOG_LEVELS["RAG"])
|
log.setLevel(SRC_LOG_LEVELS["RAG"])
|
||||||
@@ -18,6 +17,8 @@ def search_firecrawl(
|
|||||||
filter_list: Optional[List[str]] = None,
|
filter_list: Optional[List[str]] = None,
|
||||||
) -> List[SearchResult]:
|
) -> List[SearchResult]:
|
||||||
try:
|
try:
|
||||||
|
from firecrawl import Firecrawl
|
||||||
|
|
||||||
firecrawl = Firecrawl(api_key=firecrawl_api_key, api_url=firecrawl_url)
|
firecrawl = Firecrawl(api_key=firecrawl_api_key, api_url=firecrawl_url)
|
||||||
response = firecrawl.search(
|
response = firecrawl.search(
|
||||||
query=query, limit=count, ignore_invalid_urls=True, timeout=count * 3
|
query=query, limit=count, ignore_invalid_urls=True, timeout=count * 3
|
||||||
|
|||||||
Reference in New Issue
Block a user