fix: docker rag bug

This commit is contained in:
Hk-Gosuto
2024-04-08 12:42:10 +08:00
parent b00e9f0c79
commit dc4137505e
11 changed files with 20 additions and 16 deletions

View File

@@ -117,7 +117,6 @@ import {
SpeechApi,
WebTranscriptionApi,
} from "../utils/speech";
import { getServerSideConfig } from "../config/server";
import { FileInfo } from "../client/platforms/utils";
const ttsPlayer = createTTSPlayer();
@@ -507,14 +506,18 @@ export function ChatActions(props: {
);
const [showModelSelector, setShowModelSelector] = useState(false);
const [showUploadImage, setShowUploadImage] = useState(false);
const [showUploadFile, setShowUploadFile] = useState(false);
const accessStore = useAccessStore();
const isEnableRAG = useMemo(
() => accessStore.enableRAG(),
// eslint-disable-next-line react-hooks/exhaustive-deps
[],
);
useEffect(() => {
const show = isVisionModel(currentModel);
setShowUploadImage(show);
const isEnableRAG = !!process.env.NEXT_PUBLIC_ENABLE_RAG;
setShowUploadFile(isEnableRAG && !show && isSupportRAGModel(currentModel));
if (!show) {
props.setAttachImages([]);