refac
This commit is contained in:
@@ -4,6 +4,7 @@ from typing import Iterator, List, Literal, Union
|
||||
import requests
|
||||
from langchain_core.document_loaders import BaseLoader
|
||||
from langchain_core.documents import Document
|
||||
from open_webui.env import TAVILY_API_BASE_URL
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -48,7 +49,7 @@ class TavilyLoader(BaseLoader):
|
||||
self.urls = urls if isinstance(urls, list) else [urls]
|
||||
self.extract_depth = extract_depth
|
||||
self.continue_on_failure = continue_on_failure
|
||||
self.api_url = 'https://api.tavily.com/extract'
|
||||
self.api_url = f'{TAVILY_API_BASE_URL}/extract'
|
||||
|
||||
def lazy_load(self) -> Iterator[Document]:
|
||||
"""Extract and yield documents from the URLs using Tavily Extract API."""
|
||||
|
||||
Reference in New Issue
Block a user