feat: playground embedding

This commit is contained in:
jialin
2024-11-22 10:00:34 +08:00
parent 01214077d3
commit 16e2ac5b6c
33 changed files with 1518 additions and 172 deletions
+16
View File
@@ -2,6 +2,8 @@ import { request } from '@umijs/max';
export const CHAT_API = '/v1-openai/chat/completions';
export const EMBEDDING_API = '/v1-openai/embeddings';
export const OPENAI_MODELS = '/v1-openai/models';
export const RERANKER_API = '/rerank';
@@ -35,3 +37,17 @@ export const rerankerQuery = async (
cancelToken: options?.cancelToken
});
};
export const handleEmbedding = async (
params: {
model: string;
input: string[];
},
options?: any
) => {
return request(`${EMBEDDING_API}`, {
method: 'POST',
data: params,
cancelToken: options?.cancelToken
});
};