mirror of
https://github.com/open-webui/open-webui.git
synced 2026-08-25 23:14:48 -06:00
refac
This commit is contained in:
@@ -10,7 +10,6 @@ from langchain_core.documents import Document
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
DEFAULT_MICROSOFT_WEB_IQ_API_BASE_URL = 'https://api.microsoft.ai/v3'
|
||||
MICROSOFT_BROWSE_RETRY_STATUS_CODES = {202, 429, 500, 502, 503, 504}
|
||||
MICROSOFT_BROWSE_MAX_RETRIES = 2
|
||||
|
||||
@@ -27,7 +26,7 @@ class MicrosoftWebIQLoader(BaseLoader):
|
||||
continue_on_failure: bool = True,
|
||||
) -> None:
|
||||
self.urls = urls if isinstance(urls, list) else [urls]
|
||||
self.api_base_url = (api_base_url or DEFAULT_MICROSOFT_WEB_IQ_API_BASE_URL).rstrip('/')
|
||||
self.api_base_url = api_base_url.rstrip('/')
|
||||
self.api_key = api_key
|
||||
self.language = language
|
||||
self.verify_ssl = verify_ssl
|
||||
|
||||
@@ -9,8 +9,6 @@ from open_webui.utils.headers import include_user_info_headers
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
DEFAULT_MICROSOFT_WEB_IQ_API_BASE_URL = 'https://api.microsoft.ai/v3'
|
||||
|
||||
|
||||
def search_microsoft_web_iq(
|
||||
api_base_url: str,
|
||||
@@ -22,7 +20,7 @@ def search_microsoft_web_iq(
|
||||
user=None,
|
||||
) -> list[SearchResult]:
|
||||
try:
|
||||
api_base_url = (api_base_url or DEFAULT_MICROSOFT_WEB_IQ_API_BASE_URL).rstrip('/')
|
||||
api_base_url = api_base_url.rstrip('/')
|
||||
headers = {
|
||||
'host': urlparse(api_base_url).netloc or 'api.microsoft.ai',
|
||||
'x-apikey': api_key,
|
||||
|
||||
Reference in New Issue
Block a user