Merge branch 'main' of github.com:maxkb-dev/maxkb

This commit is contained in:
shaohuzhang1 2024-03-06 13:44:04 +08:00
commit cfc9c4cfd7
7 changed files with 48 additions and 17 deletions

View File

@ -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
} }

View File

@ -5,7 +5,7 @@
effect="dark" effect="dark"
placement="bottom" placement="bottom"
> >
<div ref="tagLabel" class="auto-tooltip"> <div ref="tagLabel" :class="['auto-tooltip', className]" :style="style">
<slot></slot> <slot></slot>
</div> </div>
</el-tooltip> </el-tooltip>
@ -13,6 +13,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed, onMounted, nextTick } from 'vue' import { ref, computed, onMounted, nextTick } from 'vue'
defineOptions({ name: 'AutoTooltip' }) defineOptions({ name: 'AutoTooltip' })
const props = defineProps({ className: String, style: Object })
const tagLabel = ref() const tagLabel = ref()
const containerWeight = ref(0) const containerWeight = ref(0)
const contentWeight = ref(0) const contentWeight = ref(0)

View File

@ -8,7 +8,9 @@
<img src="@/assets/icon_document.svg" style="width: 58%" alt="" /> <img src="@/assets/icon_document.svg" style="width: 58%" alt="" />
</AppAvatar> </AppAvatar>
</slot> </slot>
<h4 class="ellipsis-1" style="width: 65%">{{ title }}</h4> <auto-tooltip :content="title" style="width: 65%">
{{ title }}
</auto-tooltip>
</div> </div>
</slot> </slot>
</div> </div>
@ -76,6 +78,7 @@ function cardLeave() {
overflow: hidden; overflow: hidden;
} }
} }
.card-footer { .card-footer {
position: absolute; position: absolute;
bottom: 8px; bottom: 8px;

View File

@ -1,8 +1,8 @@
<template> <template>
<el-tag class="tag-ellipsis flex-between mb-8" effect="plain" v-bind="$attrs"> <el-tag class="tag-ellipsis flex-between mb-8" effect="plain" v-bind="$attrs">
<AutoTooltip :content="tooltipContent"> <auto-tooltip :content="tooltipContent">
<slot></slot> <slot></slot>
</AutoTooltip> </auto-tooltip>
</el-tag> </el-tag>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">

View File

@ -211,7 +211,7 @@
<el-col <el-col
:xs="24" :xs="24"
:sm="24" :sm="24"
:md="12" :md="24"
:lg="12" :lg="12"
:xl="12" :xl="12"
class="mb-8" class="mb-8"
@ -464,6 +464,17 @@ function getDataset() {
function getModel() { function getModel() {
loading.value = true loading.value = true
if (id) {
applicationApi
.getApplicationModel(id)
.then((res: any) => {
modelOptions.value = groupBy(res?.data, 'provider')
loading.value = false
})
.catch(() => {
loading.value = false
})
} else {
model model
.asyncGetModel() .asyncGetModel()
.then((res: any) => { .then((res: any) => {
@ -474,6 +485,7 @@ function getModel() {
loading.value = false loading.value = false
}) })
} }
}
function getProvider() { function getProvider() {
loading.value = true loading.value = true

View File

@ -25,7 +25,7 @@
<el-col <el-col
:xs="24" :xs="24"
:sm="12" :sm="12"
:md="8" :md="12"
:lg="8" :lg="8"
:xl="6" :xl="6"
v-for="(item, index) in paragraphDetail" v-for="(item, index) in paragraphDetail"

View File

@ -42,7 +42,7 @@
<el-col <el-col
:xs="24" :xs="24"
:sm="24" :sm="24"
:md="12" :md="24"
:lg="12" :lg="12"
:xl="12" :xl="12"
class="mb-16" class="mb-16"