mirror of
https://github.com/open-webui/open-webui
synced 2025-06-23 02:16:52 +00:00
Fix: handle individual rag config properly
This commit is contained in:
parent
b1937a9dfa
commit
8a3927a528
@ -1,9 +1,11 @@
|
||||
import { WEBUI_API_BASE_URL } from '$lib/constants';
|
||||
|
||||
export const uploadFile = async (token: string, file: File, knowledge_id: string) => {
|
||||
export const uploadFile = async (token: string, file: File, knowledge_id?: string) => {
|
||||
const data = new FormData();
|
||||
data.append('file', file);
|
||||
data.append('knowledge_id', knowledge_id);
|
||||
if (knowledge_id) {
|
||||
data.append('knowledge_id', knowledge_id);
|
||||
}
|
||||
let error = null;
|
||||
|
||||
const res = await fetch(`${WEBUI_API_BASE_URL}/files/`, {
|
||||
|
@ -17,10 +17,10 @@ export const createNewKnowledge = async (
|
||||
authorization: `Bearer ${token}`
|
||||
},
|
||||
body: JSON.stringify({
|
||||
form_data: {name: name,
|
||||
name: name,
|
||||
description: description,
|
||||
access_control: accessControl},
|
||||
rag_data: rag_config
|
||||
access_control: accessControl,
|
||||
rag_config: rag_config
|
||||
})
|
||||
})
|
||||
.then(async (res) => {
|
||||
|
@ -200,6 +200,7 @@ type EmbeddingModelUpdateForm = {
|
||||
embedding_engine: string;
|
||||
embedding_model: string;
|
||||
embedding_batch_size?: number;
|
||||
collection_name?: string;
|
||||
};
|
||||
|
||||
export const updateEmbeddingConfig = async (token: string, payload: EmbeddingModelUpdateForm) => {
|
||||
@ -264,6 +265,8 @@ export const getRerankingConfig = async (token: string, collectionForm?: Collect
|
||||
|
||||
type RerankingModelUpdateForm = {
|
||||
reranking_model: string;
|
||||
collection_name?: string;
|
||||
|
||||
};
|
||||
|
||||
export const updateRerankingConfig = async (token: string, payload: RerankingModelUpdateForm) => {
|
||||
|
Loading…
Reference in New Issue
Block a user