mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-04 14:50:30 +08:00
Feat: tenant llm provider (#14595)
### What problem does this PR solve? Python implementation of the Go-based model_provider API suite. ### Type of change - [x] New Feature (non-breaking change which adds functionality) --------- Co-authored-by: bill <yibie_jingnian@163.com>
This commit is contained in:
71
web/src/services/llm-service.ts
Normal file
71
web/src/services/llm-service.ts
Normal file
@@ -0,0 +1,71 @@
|
||||
import api from '@/utils/api';
|
||||
import { registerNextServer } from '@/utils/register-server';
|
||||
|
||||
const {
|
||||
listAllAddedModels,
|
||||
defaultModel,
|
||||
listProviders,
|
||||
addProvider,
|
||||
addProviderInstance,
|
||||
listProviderInstances,
|
||||
listInstanceModels,
|
||||
showProviderInstance,
|
||||
addInstanceModel,
|
||||
deleteProviderInstance,
|
||||
updateModelStatus,
|
||||
} = api;
|
||||
|
||||
const methods = {
|
||||
listAllAddedModels: {
|
||||
url: listAllAddedModels,
|
||||
method: 'get',
|
||||
},
|
||||
listDefaultModels: {
|
||||
url: defaultModel,
|
||||
method: 'get',
|
||||
},
|
||||
setDefaultModel: {
|
||||
url: defaultModel,
|
||||
method: 'patch',
|
||||
},
|
||||
listProviders: {
|
||||
url: listProviders,
|
||||
method: 'get',
|
||||
},
|
||||
addProvider: {
|
||||
url: addProvider,
|
||||
method: 'put',
|
||||
},
|
||||
addProviderInstance: {
|
||||
url: addProviderInstance,
|
||||
method: 'post',
|
||||
},
|
||||
listProviderInstances: {
|
||||
url: listProviderInstances,
|
||||
method: 'get',
|
||||
},
|
||||
listInstanceModels: {
|
||||
url: listInstanceModels,
|
||||
method: 'get',
|
||||
},
|
||||
showProviderInstance: {
|
||||
url: showProviderInstance,
|
||||
method: 'get',
|
||||
},
|
||||
addInstanceModel: {
|
||||
url: addInstanceModel,
|
||||
method: 'post',
|
||||
},
|
||||
deleteProviderInstance: {
|
||||
url: deleteProviderInstance,
|
||||
method: 'delete',
|
||||
},
|
||||
updateModelStatus: {
|
||||
url: updateModelStatus,
|
||||
method: 'patch',
|
||||
},
|
||||
} as const;
|
||||
|
||||
const llmService = registerNextServer<keyof typeof methods>(methods);
|
||||
|
||||
export default llmService;
|
||||
@@ -9,15 +9,6 @@ const {
|
||||
setting,
|
||||
userInfo,
|
||||
tenantInfo,
|
||||
factoriesList,
|
||||
llmList,
|
||||
myLlm,
|
||||
setApiKey,
|
||||
setTenantInfo,
|
||||
addLlm,
|
||||
deleteLlm,
|
||||
enableLlm,
|
||||
deleteFactory,
|
||||
getSystemVersion,
|
||||
getSystemTokenList,
|
||||
removeSystemToken,
|
||||
@@ -51,46 +42,10 @@ const methods = {
|
||||
url: tenantInfo,
|
||||
method: 'get',
|
||||
},
|
||||
setTenantInfo: {
|
||||
url: setTenantInfo,
|
||||
method: 'patch',
|
||||
},
|
||||
factoriesList: {
|
||||
url: factoriesList,
|
||||
method: 'get',
|
||||
},
|
||||
llmList: {
|
||||
url: llmList,
|
||||
method: 'get',
|
||||
},
|
||||
myLlm: {
|
||||
url: myLlm,
|
||||
method: 'get',
|
||||
},
|
||||
setApiKey: {
|
||||
url: setApiKey,
|
||||
method: 'post',
|
||||
},
|
||||
addLlm: {
|
||||
url: addLlm,
|
||||
method: 'post',
|
||||
},
|
||||
deleteLlm: {
|
||||
url: deleteLlm,
|
||||
method: 'post',
|
||||
},
|
||||
enableLlm: {
|
||||
url: enableLlm,
|
||||
method: 'post',
|
||||
},
|
||||
getSystemVersion: {
|
||||
url: getSystemVersion,
|
||||
method: 'get',
|
||||
},
|
||||
deleteFactory: {
|
||||
url: deleteFactory,
|
||||
method: 'post',
|
||||
},
|
||||
listToken: {
|
||||
url: getSystemTokenList,
|
||||
method: 'get',
|
||||
|
||||
Reference in New Issue
Block a user