feat: frontend integration

This commit is contained in:
Timothy J. Baek 2024-04-14 18:31:40 -04:00
parent 2952e61167
commit 9cdb5bf9fe
3 changed files with 134 additions and 33 deletions

View file

@ -346,10 +346,10 @@ export const resetVectorDB = async (token: string) => {
return res;
};
export const getEmbeddingModel = async (token: string) => {
export const getEmbeddingConfig = async (token: string) => {
let error = null;
const res = await fetch(`${RAG_API_BASE_URL}/embedding/model`, {
const res = await fetch(`${RAG_API_BASE_URL}/embedding`, {
method: 'GET',
headers: {
'Content-Type': 'application/json',
@ -374,13 +374,14 @@ export const getEmbeddingModel = async (token: string) => {
};
type EmbeddingModelUpdateForm = {
embedding_engine: string;
embedding_model: string;
};
export const updateEmbeddingModel = async (token: string, payload: EmbeddingModelUpdateForm) => {
export const updateEmbeddingConfig = async (token: string, payload: EmbeddingModelUpdateForm) => {
let error = null;
const res = await fetch(`${RAG_API_BASE_URL}/embedding/model/update`, {
const res = await fetch(`${RAG_API_BASE_URL}/embedding/update`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',