mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-05 18:33:52 +00:00
chore:upgrade wechat (#1286)
This commit is contained in:
parent
6df9f79f69
commit
cd2dcc253c
Binary file not shown.
Before Width: | Height: | Size: 134 KiB After Width: | Height: | Size: 190 KiB |
@ -26,7 +26,7 @@ class URLKnowledge(Knowledge):
|
|||||||
encoding(str, optional): csv encoding
|
encoding(str, optional): csv encoding
|
||||||
loader(Any, optional): loader
|
loader(Any, optional): loader
|
||||||
"""
|
"""
|
||||||
self._path = url
|
self._path = url or None
|
||||||
self._type = knowledge_type
|
self._type = knowledge_type
|
||||||
self._loader = loader
|
self._loader = loader
|
||||||
self._encoding = encoding
|
self._encoding = encoding
|
||||||
@ -39,8 +39,12 @@ class URLKnowledge(Knowledge):
|
|||||||
else:
|
else:
|
||||||
from langchain.document_loaders import WebBaseLoader
|
from langchain.document_loaders import WebBaseLoader
|
||||||
|
|
||||||
|
if self._path is not None:
|
||||||
web_reader = WebBaseLoader(web_path=self._path)
|
web_reader = WebBaseLoader(web_path=self._path)
|
||||||
documents = web_reader.load()
|
documents = web_reader.load()
|
||||||
|
else:
|
||||||
|
# Handle the case where self._path is None
|
||||||
|
raise ValueError("web_path cannot be None")
|
||||||
return [Document.langchain2doc(lc_document) for lc_document in documents]
|
return [Document.langchain2doc(lc_document) for lc_document in documents]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
Loading…
Reference in New Issue
Block a user