mirror of
https://github.com/open-webui/open-webui
synced 2025-06-25 09:47:41 +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';
|
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();
|
const data = new FormData();
|
||||||
data.append('file', file);
|
data.append('file', file);
|
||||||
data.append('knowledge_id', knowledge_id);
|
if (knowledge_id) {
|
||||||
|
data.append('knowledge_id', knowledge_id);
|
||||||
|
}
|
||||||
let error = null;
|
let error = null;
|
||||||
|
|
||||||
const res = await fetch(`${WEBUI_API_BASE_URL}/files/`, {
|
const res = await fetch(`${WEBUI_API_BASE_URL}/files/`, {
|
||||||
|
@ -17,10 +17,10 @@ export const createNewKnowledge = async (
|
|||||||
authorization: `Bearer ${token}`
|
authorization: `Bearer ${token}`
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
form_data: {name: name,
|
name: name,
|
||||||
description: description,
|
description: description,
|
||||||
access_control: accessControl},
|
access_control: accessControl,
|
||||||
rag_data: rag_config
|
rag_config: rag_config
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.then(async (res) => {
|
.then(async (res) => {
|
||||||
|
@ -200,6 +200,7 @@ type EmbeddingModelUpdateForm = {
|
|||||||
embedding_engine: string;
|
embedding_engine: string;
|
||||||
embedding_model: string;
|
embedding_model: string;
|
||||||
embedding_batch_size?: number;
|
embedding_batch_size?: number;
|
||||||
|
collection_name?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const updateEmbeddingConfig = async (token: string, payload: EmbeddingModelUpdateForm) => {
|
export const updateEmbeddingConfig = async (token: string, payload: EmbeddingModelUpdateForm) => {
|
||||||
@ -264,6 +265,8 @@ export const getRerankingConfig = async (token: string, collectionForm?: Collect
|
|||||||
|
|
||||||
type RerankingModelUpdateForm = {
|
type RerankingModelUpdateForm = {
|
||||||
reranking_model: string;
|
reranking_model: string;
|
||||||
|
collection_name?: string;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const updateRerankingConfig = async (token: string, payload: RerankingModelUpdateForm) => {
|
export const updateRerankingConfig = async (token: string, payload: RerankingModelUpdateForm) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user