diff --git a/src/components/Option/Playground/PlaygroundForm.tsx b/src/components/Option/Playground/PlaygroundForm.tsx index 42c2cc8..e8d4e32 100644 --- a/src/components/Option/Playground/PlaygroundForm.tsx +++ b/src/components/Option/Playground/PlaygroundForm.tsx @@ -15,6 +15,7 @@ import { KnowledgeSelect } from "../Knowledge/KnowledgeSelect" import { useSpeechRecognition } from "@/hooks/useSpeechRecognition" import { PiGlobe } from "react-icons/pi" import { handleChatInputKeyDown } from "@/utils/key-down" +import { getIsSimpleInternetSearch } from "@/services/search" type Props = { dropedFile: File | undefined @@ -181,7 +182,8 @@ export const PlaygroundForm = ({ dropedFile }: Props) => { } if (webSearch) { const defaultEM = await defaultEmbeddingModelForRag() - if (!defaultEM) { + const simpleSearch = await getIsSimpleInternetSearch() + if (!defaultEM && !simpleSearch) { form.setFieldError("message", t("formError.noEmbeddingModel")) return } diff --git a/src/components/Sidepanel/Chat/form.tsx b/src/components/Sidepanel/Chat/form.tsx index 7d0c376..5c6789f 100644 --- a/src/components/Sidepanel/Chat/form.tsx +++ b/src/components/Sidepanel/Chat/form.tsx @@ -20,6 +20,7 @@ import { ModelSelect } from "@/components/Common/ModelSelect" import { useSpeechRecognition } from "@/hooks/useSpeechRecognition" import { PiGlobeX, PiGlobe } from "react-icons/pi" import { handleChatInputKeyDown } from "@/utils/key-down" +import { getIsSimpleInternetSearch } from "@/services/search" type Props = { dropedFile: File | undefined @@ -99,7 +100,8 @@ export const SidepanelForm = ({ dropedFile }: Props) => { } if (webSearch) { const defaultEM = await defaultEmbeddingModelForRag() - if (!defaultEM) { + const simpleSearch = await getIsSimpleInternetSearch() + if (!defaultEM && !simpleSearch) { form.setFieldError("message", t("formError.noEmbeddingModel")) return }