From 305ec59d7602f1dac60cf299c147a0e546e4c58c Mon Sep 17 00:00:00 2001 From: Que Nguyen Date: Wed, 12 Jun 2024 21:33:33 +0700 Subject: [PATCH 1/3] Set searxng language as 'auto' and enable safesearch (moderate). Configure searxng with language param set to auto and add "safesearch": 1 (moderate) for safer web results. --- backend/apps/rag/search/searxng.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/apps/rag/search/searxng.py b/backend/apps/rag/search/searxng.py index a62ab5089..d0de32190 100644 --- a/backend/apps/rag/search/searxng.py +++ b/backend/apps/rag/search/searxng.py @@ -25,6 +25,7 @@ def search_searxng( Keyword Args: language (str): Language filter for the search results; e.g., "en-US". Defaults to an empty string. + safesearch (int): Safe search filter for safer web results; 0 = off, 1 = moderate, 2 = strict. Defaults to 1 (moderate). time_range (str): Time range for filtering results by date; e.g., "2023-04-05..today" or "all-time". Defaults to ''. categories: (Optional[List[str]]): Specific categories within which the search should be performed, defaulting to an empty string if not provided. @@ -36,7 +37,8 @@ def search_searxng( """ # Default values for optional parameters are provided as empty strings or None when not specified. - language = kwargs.get("language", "en-US") + language = kwargs.get("language", "auto") + safesearch = kwargs.get("safesearch", "1") time_range = kwargs.get("time_range", "") categories = "".join(kwargs.get("categories", [])) @@ -44,6 +46,7 @@ def search_searxng( "q": query, "format": "json", "pageno": 1, + "safesearch": safesearch, "language": language, "time_range": time_range, "categories": categories, From 1fefafb254dc2ade19091c9571a468528c6d3718 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Wed, 12 Jun 2024 11:44:05 -0700 Subject: [PATCH 2/3] refac --- src/lib/components/chat/MessageInput.svelte | 2 +- src/lib/components/chat/MessageInput/CallOverlay.svelte | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index 50414634b..46cc4ad93 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -935,7 +935,7 @@ } // check if user has access to getUserMedia try { - await navigator.mediaDevices.getUserMedia({ audio: true, video: true }); + await navigator.mediaDevices.getUserMedia({ audio: true }); // If the user grants the permission, proceed to show the call overlay showCallOverlay.set(true); diff --git a/src/lib/components/chat/MessageInput/CallOverlay.svelte b/src/lib/components/chat/MessageInput/CallOverlay.svelte index 295750c9e..3b85d73d1 100644 --- a/src/lib/components/chat/MessageInput/CallOverlay.svelte +++ b/src/lib/components/chat/MessageInput/CallOverlay.svelte @@ -626,7 +626,8 @@