mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-12-24 09:05:59 +08:00
merge v4.1.1 and fixed conflicts
This commit is contained in:
@@ -2,14 +2,7 @@
|
||||
<div class="container model-list" v-loading="loading">
|
||||
|
||||
<div class="handle-box">
|
||||
<el-select v-model="query.platform" placeholder="平台" class="handle-input">
|
||||
<el-option
|
||||
v-for="item in platforms"
|
||||
:key="item.value"
|
||||
:label="item.name"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
<el-input v-model="query.name" placeholder="模型名称" class="handle-input" />
|
||||
|
||||
<el-button :icon="Search" @click="fetchData">搜索</el-button>
|
||||
<el-button type="primary" :icon="Plus" @click="add">新增</el-button>
|
||||
@@ -17,11 +10,6 @@
|
||||
|
||||
<el-row>
|
||||
<el-table :data="items" :row-key="row => row.id" table-layout="auto">
|
||||
<el-table-column prop="platform" label="所属平台">
|
||||
<template #default="scope">
|
||||
<span class="sort" :data-id="scope.row.id">{{ scope.row.platform }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="模型名称"/>
|
||||
<el-table-column prop="value" label="模型值">
|
||||
<template #default="scope">
|
||||
@@ -46,11 +34,6 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- <el-table-column label="创建时间">-->
|
||||
<!-- <template #default="scope">-->
|
||||
<!-- <span>{{ dateFormat(scope.row['created_at']) }}</span>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column prop="key_name" label="绑定API-KEY"/>
|
||||
<el-table-column label="操作" width="180">
|
||||
<template #default="scope">
|
||||
@@ -72,15 +55,6 @@
|
||||
style="width: 90%; max-width: 600px;"
|
||||
>
|
||||
<el-form :model="item" label-width="120px" ref="formRef" :rules="rules">
|
||||
<el-form-item label="所属平台:" prop="platform">
|
||||
<el-select v-model="item.platform" placeholder="请选择平台">
|
||||
<el-option v-for="item in platforms" :value="item.value" :label="item.name" :key="item.value">{{
|
||||
item.name
|
||||
}}
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="模型名称:" prop="name">
|
||||
<el-input v-model="item.name" autocomplete="off"/>
|
||||
</el-form-item>
|
||||
@@ -89,7 +63,7 @@
|
||||
<el-input v-model="item.value" autocomplete="off"/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="费率:" prop="weight">
|
||||
<el-form-item label="消耗算力:" prop="weight">
|
||||
<template #default>
|
||||
<div class="tip-input">
|
||||
<el-input-number :min="0" v-model="item.power" autocomplete="off"/>
|
||||
@@ -121,18 +95,7 @@
|
||||
class="box-item"
|
||||
effect="dark"
|
||||
raw-content
|
||||
content="gpt-3.5-turbo:4096 <br/>
|
||||
gpt-3.5-turbo-16k: 16384 <br/>
|
||||
gpt-4: 8192 <br/>
|
||||
gpt-4-32k: 32768 <br/>
|
||||
chatglm_pro: 32768 <br/>
|
||||
chatglm_std: 16384 <br/>
|
||||
chatglm_lite: 4096 <br/>
|
||||
qwen-turbo: 8192 <br/>
|
||||
qwen-plus: 32768 <br/>
|
||||
文心一言: 8192 <br/>
|
||||
星火1.0: 4096 <br/>
|
||||
星火2.0-星火3.5: 8192"
|
||||
content="去各大模型的官方 API 文档查询模型支持的最大上下文长度"
|
||||
placement="right"
|
||||
>
|
||||
<el-icon>
|
||||
@@ -214,18 +177,16 @@ import ClipboardJS from "clipboard";
|
||||
|
||||
// 变量定义
|
||||
const items = ref([])
|
||||
const query = ref({platform:''})
|
||||
const query = ref({name:''})
|
||||
const item = ref({})
|
||||
const showDialog = ref(false)
|
||||
const title = ref("")
|
||||
const rules = reactive({
|
||||
platform: [{required: true, message: '请选择平台', trigger: 'change',}],
|
||||
name: [{required: true, message: '请输入模型名称', trigger: 'change',}],
|
||||
value: [{required: true, message: '请输入模型值', trigger: 'change',}]
|
||||
})
|
||||
const loading = ref(true)
|
||||
const formRef = ref(null)
|
||||
const platforms = ref([])
|
||||
|
||||
// 获取 API KEY
|
||||
const apiKeys = ref([])
|
||||
@@ -290,12 +251,6 @@ onMounted(() => {
|
||||
clipboard.value.on('error', () => {
|
||||
ElMessage.error('复制失败!');
|
||||
})
|
||||
|
||||
httpGet("/api/admin/config/get/app").then(res => {
|
||||
platforms.value = res.data.platforms
|
||||
}).catch(e =>{
|
||||
ElMessage.error("获取配置失败:"+e.message)
|
||||
})
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
@@ -305,7 +260,7 @@ onUnmounted(() => {
|
||||
const add = function () {
|
||||
title.value = "新增模型"
|
||||
showDialog.value = true
|
||||
item.value = {enabled: true, weight: 1, open: true}
|
||||
item.value = {enabled: true, power: 1, open: true,max_tokens: 1024,max_context: 8192, temperature: 0.9,}
|
||||
}
|
||||
|
||||
const edit = function (row) {
|
||||
|
||||
Reference in New Issue
Block a user