feat: AI模型
This commit is contained in:
parent
71c29e81c9
commit
647eada388
@ -216,6 +216,20 @@ const getApplicationHitTest: (
|
|||||||
return get(`${prefix}/${application_id}/hit_test`, data, loading)
|
return get(`${prefix}/${application_id}/hit_test`, data, loading)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前用户可使用的模型列表
|
||||||
|
* @param application_id
|
||||||
|
* @param loading
|
||||||
|
* @query { query_text: string, top_number: number, similarity: number }
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
const getApplicationModel: (
|
||||||
|
application_id: string,
|
||||||
|
loading?: Ref<boolean>
|
||||||
|
) => Promise<Result<Array<any>>> = (application_id, loading) => {
|
||||||
|
return get(`${prefix}/${application_id}/model`, loading)
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
getAllAppilcation,
|
getAllAppilcation,
|
||||||
getApplication,
|
getApplication,
|
||||||
@ -232,5 +246,6 @@ export default {
|
|||||||
postAppAuthentication,
|
postAppAuthentication,
|
||||||
getProfile,
|
getProfile,
|
||||||
putChatVote,
|
putChatVote,
|
||||||
getApplicationHitTest
|
getApplicationHitTest,
|
||||||
|
getApplicationModel
|
||||||
}
|
}
|
||||||
|
|||||||
@ -464,15 +464,27 @@ function getDataset() {
|
|||||||
|
|
||||||
function getModel() {
|
function getModel() {
|
||||||
loading.value = true
|
loading.value = true
|
||||||
model
|
if (id) {
|
||||||
.asyncGetModel()
|
applicationApi
|
||||||
.then((res: any) => {
|
.getApplicationModel(id)
|
||||||
modelOptions.value = groupBy(res?.data, 'provider')
|
.then((res: any) => {
|
||||||
loading.value = false
|
modelOptions.value = groupBy(res?.data, 'provider')
|
||||||
})
|
loading.value = false
|
||||||
.catch(() => {
|
})
|
||||||
loading.value = false
|
.catch(() => {
|
||||||
})
|
loading.value = false
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
model
|
||||||
|
.asyncGetModel()
|
||||||
|
.then((res: any) => {
|
||||||
|
modelOptions.value = groupBy(res?.data, 'provider')
|
||||||
|
loading.value = false
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
loading.value = false
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getProvider() {
|
function getProvider() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user