This commit is contained in:
Timothy Jaeryang Baek 2024-11-20 10:02:07 -08:00
parent c0055afdb3
commit 4156b62811

View File

@ -23,6 +23,7 @@ from open_webui.apps.retrieval.vector.connector import VECTOR_DB_CLIENT
# Document loaders # Document loaders
from open_webui.apps.retrieval.loaders.main import Loader from open_webui.apps.retrieval.loaders.main import Loader
from open_webui.apps.retrieval.loaders.youtube import YoutubeLoader
# Web search engines # Web search engines
from open_webui.apps.retrieval.web.main import SearchResult from open_webui.apps.retrieval.web.main import SearchResult
@ -120,9 +121,6 @@ from open_webui.utils.misc import (
from open_webui.utils.utils import get_admin_user, get_verified_user from open_webui.utils.utils import get_admin_user, get_verified_user
from langchain.text_splitter import RecursiveCharacterTextSplitter, TokenTextSplitter from langchain.text_splitter import RecursiveCharacterTextSplitter, TokenTextSplitter
from langchain_community.document_loaders import (
YoutubeLoader,
)
from langchain_core.documents import Document from langchain_core.documents import Document
@ -1059,7 +1057,7 @@ def process_youtube_video(form_data: ProcessUrlForm, user=Depends(get_verified_u
if not collection_name: if not collection_name:
collection_name = calculate_sha256_string(form_data.url)[:63] collection_name = calculate_sha256_string(form_data.url)[:63]
loader = YoutubeLoader.from_youtube_url( loader = YoutubeLoader(
form_data.url, language=app.state.config.YOUTUBE_LOADER_LANGUAGE form_data.url, language=app.state.config.YOUTUBE_LOADER_LANGUAGE
) )