feat: Add option to enable internet search by default
This commit is contained in:
@@ -39,7 +39,8 @@ export const PlaygroundForm = ({ dropedFile }: Props) => {
|
||||
selectedKnowledge,
|
||||
temporaryChat,
|
||||
useOCR,
|
||||
setUseOCR
|
||||
setUseOCR,
|
||||
defaultInternetSearchOn
|
||||
} = useMessageOption()
|
||||
|
||||
const isMobile = () => {
|
||||
@@ -71,8 +72,17 @@ export const PlaygroundForm = ({ dropedFile }: Props) => {
|
||||
|
||||
React.useEffect(() => {
|
||||
textAreaFocus()
|
||||
if (defaultInternetSearchOn) {
|
||||
setWebSearch(true)
|
||||
}
|
||||
}, [])
|
||||
|
||||
React.useEffect(() => {
|
||||
if (defaultInternetSearchOn) {
|
||||
setWebSearch(true)
|
||||
}
|
||||
}, [defaultInternetSearchOn])
|
||||
|
||||
const onInputChange = async (
|
||||
e: React.ChangeEvent<HTMLInputElement> | File
|
||||
) => {
|
||||
|
||||
@@ -19,7 +19,8 @@ export const SearchModeSettings = () => {
|
||||
searxngURL: "",
|
||||
searxngJSONMode: false,
|
||||
braveApiKey: "",
|
||||
googleDomain: ""
|
||||
googleDomain: "",
|
||||
defaultInternetSearchOn: false
|
||||
}
|
||||
})
|
||||
|
||||
@@ -171,6 +172,19 @@ export const SearchModeSettings = () => {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex sm:flex-row flex-col space-y-4 sm:space-y-0 sm:justify-between">
|
||||
<span className="text-gray-700 dark:text-neutral-50 ">
|
||||
{t("generalSettings.webSearch.searchOnByDefault.label")}
|
||||
</span>
|
||||
<div>
|
||||
<Switch
|
||||
className="mt-4 sm:mt-0"
|
||||
{...form.getInputProps("defaultInternetSearchOn", {
|
||||
type: "checkbox"
|
||||
})}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex justify-end">
|
||||
<SaveButton btnType="submit" />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user