mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-27 23:59:20 -05:00
refac: limit the number of search words used for chat search (#33844)
Chat search now uses at most the first 12 distinct words of the query.
This commit is contained in:
1 parent
d2a8374f3a
commit
639766f7f9
1 file changed
+1
-1
@@ -58,7 +58,7 @@ def chat_search_content_query(text: str) -> str:
|
||||
|
||||
|
||||
def chat_search_terms(text: str) -> list[str]:
|
||||
return list(dict.fromkeys(re.findall(r'[a-z0-9]+', text.lower())))
|
||||
return list(dict.fromkeys(re.findall(r'[a-z0-9]+', text.lower())))[:12]
|
||||
|
||||
|
||||
def chat_message_list(chat: dict) -> list:
|
||||
|
||||
Reference in new issue
Block a user