mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
Merge branch 'main' of github.com:maxkb-dev/maxkb
This commit is contained in:
commit
cfc9c4cfd7
|
|
@ -216,6 +216,20 @@ const getApplicationHitTest: (
|
|||
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 {
|
||||
getAllAppilcation,
|
||||
getApplication,
|
||||
|
|
@ -232,5 +246,6 @@ export default {
|
|||
postAppAuthentication,
|
||||
getProfile,
|
||||
putChatVote,
|
||||
getApplicationHitTest
|
||||
getApplicationHitTest,
|
||||
getApplicationModel
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
effect="dark"
|
||||
placement="bottom"
|
||||
>
|
||||
<div ref="tagLabel" class="auto-tooltip">
|
||||
<div ref="tagLabel" :class="['auto-tooltip', className]" :style="style">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</el-tooltip>
|
||||
|
|
@ -13,6 +13,7 @@
|
|||
<script setup lang="ts">
|
||||
import { ref, computed, onMounted, nextTick } from 'vue'
|
||||
defineOptions({ name: 'AutoTooltip' })
|
||||
const props = defineProps({ className: String, style: Object })
|
||||
const tagLabel = ref()
|
||||
const containerWeight = ref(0)
|
||||
const contentWeight = ref(0)
|
||||
|
|
|
|||
|
|
@ -8,7 +8,9 @@
|
|||
<img src="@/assets/icon_document.svg" style="width: 58%" alt="" />
|
||||
</AppAvatar>
|
||||
</slot>
|
||||
<h4 class="ellipsis-1" style="width: 65%">{{ title }}</h4>
|
||||
<auto-tooltip :content="title" style="width: 65%">
|
||||
{{ title }}
|
||||
</auto-tooltip>
|
||||
</div>
|
||||
</slot>
|
||||
</div>
|
||||
|
|
@ -76,6 +78,7 @@ function cardLeave() {
|
|||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
.card-footer {
|
||||
position: absolute;
|
||||
bottom: 8px;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<template>
|
||||
<el-tag class="tag-ellipsis flex-between mb-8" effect="plain" v-bind="$attrs">
|
||||
<AutoTooltip :content="tooltipContent">
|
||||
<auto-tooltip :content="tooltipContent">
|
||||
<slot></slot>
|
||||
</AutoTooltip>
|
||||
</auto-tooltip>
|
||||
</el-tag>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@
|
|||
<el-col
|
||||
:xs="24"
|
||||
:sm="24"
|
||||
:md="12"
|
||||
:md="24"
|
||||
:lg="12"
|
||||
:xl="12"
|
||||
class="mb-8"
|
||||
|
|
@ -464,15 +464,27 @@ function getDataset() {
|
|||
|
||||
function getModel() {
|
||||
loading.value = true
|
||||
model
|
||||
.asyncGetModel()
|
||||
.then((res: any) => {
|
||||
modelOptions.value = groupBy(res?.data, 'provider')
|
||||
loading.value = false
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false
|
||||
})
|
||||
if (id) {
|
||||
applicationApi
|
||||
.getApplicationModel(id)
|
||||
.then((res: any) => {
|
||||
modelOptions.value = groupBy(res?.data, 'provider')
|
||||
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() {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
<el-col
|
||||
:xs="24"
|
||||
:sm="12"
|
||||
:md="8"
|
||||
:md="12"
|
||||
:lg="8"
|
||||
:xl="6"
|
||||
v-for="(item, index) in paragraphDetail"
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@
|
|||
<el-col
|
||||
:xs="24"
|
||||
:sm="24"
|
||||
:md="12"
|
||||
:md="24"
|
||||
:lg="12"
|
||||
:xl="12"
|
||||
class="mb-16"
|
||||
|
|
|
|||
Loading…
Reference in New Issue