refac: modernize imports, standardize type hints and docstrings

This commit is contained in:
Timothy Jaeryang Baek committed 2026-05-12 06:30:38 +09:00
1 parent 998c86a52b
commit a59c967d7e
16 files changed
+118 -142

No files matched your search

+5 -8
View File
@@ -1,13 +1,11 @@
import validators
from __future__ import annotations
from typing import Optional
from urllib.parse import urlparse
from pydantic import BaseModel
import validators
from open_webui.retrieval.web.utils import resolve_hostname
from open_webui.utils.misc import is_string_allowed
from pydantic import BaseModel
def get_filtered_results(results, filter_list):
if not filter_list:
@@ -39,8 +37,7 @@ def get_filtered_results(results, filter_list):
return filtered_results
class SearchResult(BaseModel):
link: str
title: Optional[str]
snippet: Optional[str]
title: str | None
snippet: str | None