feat: Enhance embedding model validation by incorporating simple internet search check
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user