This commit is contained in:
Timothy Jaeryang Baek
2026-08-31 00:39:16 -04:00
parent b6d5055228
commit 873fb741c2
11 changed files with 22 additions and 22 deletions
+1 -1
View File
@@ -362,7 +362,7 @@ class MessageStats(BaseModel):
token_count: int | None = None
timestamp: int | None = None
rating: int | None = None # Derived from message.annotation.rating
tags: list[str | None] = None # Derived from message.annotation.tags
tags: list[str] | None = None # Derived from message.annotation.tags
class ChatHistoryStats(BaseModel):
+3 -3
View File
@@ -47,7 +47,7 @@ class PromptModel(BaseModel):
content: str
data: dict | None = None
meta: dict | None = None
tags: list[str | None] = None
tags: list[str] | None = None
is_active: bool | None = True
version_id: str | None = None
created_at: int | None = None
@@ -86,7 +86,7 @@ class PromptForm(BaseModel):
content: str
data: dict | None = None
meta: dict | None = None
tags: list[str | None] = None
tags: list[str] | None = None
access_grants: list[dict] | None = None
version_id: str | None = None # Active version
commit_message: str | None = None # For history tracking
@@ -558,7 +558,7 @@ class PromptsTable:
prompt_id: str,
name: str,
command: str,
tags: list[str | None] = None,
tags: list[str] | None = None,
db: AsyncSession | None = None,
) -> PromptModel | None:
"""Update only name, command, and tags (no history created)."""
@@ -12,7 +12,7 @@ log = logging.getLogger(__name__)
def search_duckduckgo(
query: str,
count: int,
filter_list: list[str | None] = None,
filter_list: list[str] | None = None,
concurrent_requests: int | None = None,
backend: str | None = 'auto',
) -> list[SearchResult]:
+1 -1
View File
@@ -8,7 +8,7 @@ from open_webui.retrieval.web.main import SearchResult, get_filtered_results
log = logging.getLogger(__name__)
def search_mojeek(api_key: str, query: str, count: int, filter_list: list[str | None] = None) -> list[SearchResult]:
def search_mojeek(api_key: str, query: str, count: int, filter_list: list[str] | None = None) -> list[SearchResult]:
"""Search using Mojeek's Search API and return the results as a list of SearchResult objects.
Args:
+1 -1
View File
@@ -17,7 +17,7 @@ def search_serply(
limit: int = 10,
device_type: str = 'desktop',
proxy_location: str = 'US',
filter_list: list[str | None] = None,
filter_list: list[str] | None = None,
) -> list[SearchResult]:
"""Search using serper.dev's API and return the results as a list of SearchResult objects.
+1 -1
View File
@@ -13,7 +13,7 @@ def search_tavily(
api_key: str,
query: str,
count: int,
filter_list: list[str | None] = None,
filter_list: list[str] | None = None,
# **kwargs,
) -> list[SearchResult]:
"""Search using Tavily's Search API and return the results as a list of SearchResult objects.
+1 -1
View File
@@ -1074,7 +1074,7 @@ async def update_external_knowledge_source(
class KnowledgeFilesResponse(KnowledgeResponse):
files: list[FileMetadataResponse | None] = None
files: list[FileMetadataResponse] | None = None
write_access: bool | None = False
+5 -5
View File
@@ -970,12 +970,12 @@ class GenerateCompletionForm(BaseModel):
model: str
prompt: str | None = None
suffix: str | None = None
images: list[str | None] = None
images: list[str] | None = None
format: Union[dict, str | None] = None
options: dict | None = None
system: str | None = None
template: str | None = None
context: list[int | None] = None
context: list[int] | None = None
stream: bool | None = True
raw: bool | None = None
keep_alive: Union[int, str | None] = None
@@ -1026,8 +1026,8 @@ class ChatMessage(BaseModel):
role: str
content: str | None = None
tool_calls: list[dict | None] = None
images: list[str | None] = None
tool_calls: list[dict] | None = None
images: list[str] | None = None
model_config = ConfigDict(extra='allow')
@validator('content', pre=True)
@@ -1048,7 +1048,7 @@ class GenerateChatCompletionForm(BaseModel):
template: str | None = None
stream: bool | None = True
keep_alive: Union[int, str | None] = None
tools: list[dict | None] = None
tools: list[dict] | None = None
model_config = ConfigDict(extra='allow')
+1 -1
View File
@@ -36,7 +36,7 @@ class PromptVersionUpdateForm(BaseModel):
class PromptMetadataForm(BaseModel):
name: str
command: str
tags: list[str | None] = None
tags: list[str] | None = None
router = APIRouter()
+2 -2
View File
@@ -848,7 +848,7 @@ class WebConfig(BaseModel):
EXTERNAL_WEB_SEARCH_API_KEY: str | None = None
EXTERNAL_WEB_LOADER_URL: str | None = None
EXTERNAL_WEB_LOADER_API_KEY: str | None = None
YOUTUBE_LOADER_LANGUAGE: list[str | None] = None
YOUTUBE_LOADER_LANGUAGE: list[str] | None = None
YOUTUBE_LOADER_PROXY_URL: str | None = None
YOUTUBE_LOADER_TRANSLATION: str | None = None
YANDEX_WEB_SEARCH_URL: str | None = None
@@ -938,7 +938,7 @@ class ConfigForm(BaseModel):
FILE_MAX_COUNT: Union[int, str | None] = None
FILE_IMAGE_COMPRESSION_WIDTH: Union[int, str | None] = None
FILE_IMAGE_COMPRESSION_HEIGHT: Union[int, str | None] = None
ALLOWED_FILE_EXTENSIONS: list[str | None] = None
ALLOWED_FILE_EXTENSIONS: list[str] | None = None
# Integration settings
ENABLE_GOOGLE_DRIVE_INTEGRATION: bool | None = None
+5 -5
View File
@@ -89,7 +89,7 @@ def get_allow_block_lists(filter_list):
return allow_list, block_list
def is_string_allowed(string: Union[str, Sequence[str]], filter_list: list[str | None] = None) -> bool:
def is_string_allowed(string: Union[str, Sequence[str]], filter_list: list[str] | None = None) -> bool:
"""
Checks if a string is allowed based on the provided filter list.
:param string: The string or sequence of strings to check (e.g., domain or hostname).
@@ -150,7 +150,7 @@ def _host_matches_pattern(host: str, pattern: str) -> bool:
return host == pattern or host.endswith('.' + pattern)
def is_host_allowed(host: Union[str, Sequence[str]], filter_list: list[str | None] = None) -> bool:
def is_host_allowed(host: Union[str, Sequence[str]], filter_list: list[str] | None = None) -> bool:
"""Allow/block a hostname (or list of hostnames / resolved IPs) against a
WEB_FETCH_FILTER_LIST-style filter, matching on label boundaries.
@@ -172,7 +172,7 @@ def is_host_allowed(host: Union[str, Sequence[str]], filter_list: list[str | Non
return not is_host_blocked(hosts, filter_list)
def is_host_blocked(host: Union[str, Sequence[str]], filter_list: list[str | None] = None) -> bool:
def is_host_blocked(host: Union[str, Sequence[str]], filter_list: list[str] | None = None) -> bool:
"""Whether a host or resolved address matches a block entry, ignoring any allow entries."""
_, block_list = get_allow_block_lists(filter_list)
hosts = [host] if isinstance(host, str) else list(host or [])
@@ -778,7 +778,7 @@ def openai_chat_chunk_message_template(
model: str,
content: str | None = None,
reasoning_content: str | None = None,
tool_calls: list[dict | None] = None,
tool_calls: list[dict] | None = None,
usage: dict | None = None,
message_id: str | None = None,
) -> dict:
@@ -809,7 +809,7 @@ def openai_chat_completion_message_template(
model: str,
message: str | None = None,
reasoning_content: str | None = None,
tool_calls: list[dict | None] = None,
tool_calls: list[dict] | None = None,
usage: dict | None = None,
) -> dict:
template = openai_chat_message_template(model)