refac
This commit is contained in:
@@ -30,6 +30,9 @@ class ExternalWebLoader(BaseLoader):
|
||||
response = requests.post(
|
||||
self.external_url,
|
||||
headers={
|
||||
# LICENSE covers this Open WebUI user-agent identifier.
|
||||
# Do not alter, remove, obscure, or replace it except as LICENSE permits:
|
||||
# https://docs.openwebui.com/license.
|
||||
'User-Agent': 'Open WebUI (https://github.com/open-webui/open-webui) External Web Loader',
|
||||
'Authorization': f'Bearer {self.external_api_key}',
|
||||
},
|
||||
|
||||
@@ -21,6 +21,9 @@ def search_external(
|
||||
) -> List[SearchResult]:
|
||||
try:
|
||||
headers = {
|
||||
# LICENSE covers this Open WebUI user-agent identifier.
|
||||
# Do not alter, remove, obscure, or replace it except as LICENSE permits:
|
||||
# https://docs.openwebui.com/license.
|
||||
'User-Agent': 'Open WebUI (https://github.com/open-webui/open-webui) RAG Bot',
|
||||
'Authorization': f'Bearer {external_api_key}',
|
||||
}
|
||||
|
||||
@@ -12,6 +12,9 @@ log = logging.getLogger(__name__)
|
||||
|
||||
# SearXNG request headers — identifies the bot to instance operators.
|
||||
_SEARXNG_HEADERS = {
|
||||
# LICENSE covers this Open WebUI user-agent identifier.
|
||||
# Do not alter, remove, obscure, or replace it except as LICENSE permits:
|
||||
# https://docs.openwebui.com/license.
|
||||
'User-Agent': 'Open WebUI (https://github.com/open-webui/open-webui) RAG Bot',
|
||||
'Accept': 'text/html',
|
||||
'Accept-Encoding': 'gzip, deflate',
|
||||
|
||||
@@ -59,6 +59,9 @@ def search_yacy(
|
||||
query_url,
|
||||
auth=yacy_auth,
|
||||
headers={
|
||||
# LICENSE covers this Open WebUI user-agent identifier.
|
||||
# Do not alter, remove, obscure, or replace it except as LICENSE permits:
|
||||
# https://docs.openwebui.com/license.
|
||||
'User-Agent': 'Open WebUI (https://github.com/open-webui/open-webui) RAG Bot',
|
||||
'Accept': 'text/html',
|
||||
'Accept-Encoding': 'gzip, deflate',
|
||||
|
||||
@@ -41,6 +41,9 @@ def search_yandex(
|
||||
) -> List[SearchResult]:
|
||||
try:
|
||||
headers = {
|
||||
# LICENSE covers this Open WebUI user-agent identifier.
|
||||
# Do not alter, remove, obscure, or replace it except as LICENSE permits:
|
||||
# https://docs.openwebui.com/license.
|
||||
'User-Agent': 'Open WebUI (https://github.com/open-webui/open-webui) RAG Bot',
|
||||
'Authorization': f'Api-Key {yandex_search_api_key}',
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user