mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
refac: web/rag config
This commit is contained in:
@@ -50,9 +50,9 @@ type YoutubeConfigForm = {
|
||||
};
|
||||
|
||||
type RAGConfigForm = {
|
||||
pdf_extract_images?: boolean;
|
||||
enable_google_drive_integration?: boolean;
|
||||
enable_onedrive_integration?: boolean;
|
||||
PDF_EXTRACT_IMAGES?: boolean;
|
||||
ENABLE_GOOGLE_DRIVE_INTEGRATION?: boolean;
|
||||
ENABLE_ONEDRIVE_INTEGRATION?: boolean;
|
||||
chunk?: ChunkConfigForm;
|
||||
content_extraction?: ContentExtractConfigForm;
|
||||
web_loader_ssl_verification?: boolean;
|
||||
@@ -89,33 +89,6 @@ export const updateRAGConfig = async (token: string, payload: RAGConfigForm) =>
|
||||
return res;
|
||||
};
|
||||
|
||||
export const getRAGTemplate = async (token: string) => {
|
||||
let error = null;
|
||||
|
||||
const res = await fetch(`${RETRIEVAL_API_BASE_URL}/template`, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: `Bearer ${token}`
|
||||
}
|
||||
})
|
||||
.then(async (res) => {
|
||||
if (!res.ok) throw await res.json();
|
||||
return res.json();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log(err);
|
||||
error = err.detail;
|
||||
return null;
|
||||
});
|
||||
|
||||
if (error) {
|
||||
throw error;
|
||||
}
|
||||
|
||||
return res?.template ?? '';
|
||||
};
|
||||
|
||||
export const getQuerySettings = async (token: string) => {
|
||||
let error = null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user