第一次提交
This commit is contained in:
@@ -0,0 +1,529 @@
|
||||
<template>
|
||||
<BasicModal destroyOnClose @register="registerModal" :canFullscreen="false" width="600px" wrapClassName="ai-model-modal">
|
||||
<div class="modal">
|
||||
<div class="header">
|
||||
<span class="header-title">
|
||||
<span v-if="dataIndex ==='list' || dataIndex ==='add'" :class="dataIndex === 'list' ? '' : 'add-header-title pointer'" @click="goToList">
|
||||
选择供应商
|
||||
<a-tooltip title="供应商文档" v-if="dataIndex ==='list'">
|
||||
<a style="color: #333333" href="https://help.jeecg.com/aigc/guide/model/#2-%E4%BE%9B%E5%BA%94%E5%95%86%E9%80%89%E6%8B%A9" target="_blank">
|
||||
<Icon style="position:relative;left: -2px;top:1px" icon="ant-design:question-circle-outlined"></Icon>
|
||||
</a>
|
||||
</a-tooltip>
|
||||
</span>
|
||||
<span v-if="dataIndex === 'add'" class="add-header-title"> > </span>
|
||||
<span v-if="dataIndex === 'add'" style="color: #1f2329">添加 {{ providerName }}</span>
|
||||
</span>
|
||||
|
||||
<a-select v-if="dataIndex === 'list'" :bordered="false" class="header-select" size="small" v-model:value="modelType" @change="handleChange">
|
||||
<a-select-option v-for="item in modelTypeOption" :value="item.value">{{ item.text }}</a-select-option>
|
||||
</a-select>
|
||||
</div>
|
||||
<div class="model-content" v-if="dataIndex === 'list'">
|
||||
<a-row :span="24">
|
||||
<a-col :xxl="12" :xl="12" :lg="12" :md="12" :sm="12" :xs="24" v-for="item in modelTypeList">
|
||||
<a-card class="model-card" @click="handleClick(item)">
|
||||
<div class="model-header">
|
||||
<div class="flex">
|
||||
<img :src="getImage(item.value)" class="header-img" />
|
||||
<div class="header-text">{{ item.title }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
<a-tabs v-model:activeKey="activeKey" v-if="dataIndex === 'add' || dataIndex === 'edit'">
|
||||
<a-tab-pane :key="1">
|
||||
<template #tab>
|
||||
<span style="display: flex">
|
||||
基础信息
|
||||
<a-tooltip title="基础信息文档">
|
||||
<a @click.stop style="color: unset" href="https://help.jeecg.com/aigc/guide/model/#31-%E5%A1%AB%E5%86%99%E5%9F%BA%E7%A1%80%E4%BF%A1%E6%81%AF" target="_blank">
|
||||
<Icon style="position:relative;left:2px;top:1px" icon="ant-design:question-circle-outlined"></Icon>
|
||||
</a>
|
||||
</a-tooltip>
|
||||
</span>
|
||||
</template>
|
||||
<div class="model-content">
|
||||
<BasicForm @register="registerForm">
|
||||
<template #modelType="{ model, field }">
|
||||
<a-select v-model:value="model[field]" @change="handleModelTypeChange" :disabled="modelTypeDisabled">
|
||||
<a-select-option v-for="item in modelTypeAddOption" :value="item">
|
||||
<span v-if="item === 'LLM'">语言模型</span>
|
||||
<span v-else-if="item === 'EMBED'">向量模型</span>
|
||||
<span v-else-if="item === 'IMAGE'">图像模型</span>
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</template>
|
||||
|
||||
<template #modelName="{ model, field }">
|
||||
<AutoComplete v-model:value="model[field]" :options="modelNameAddOption" :filter-option="filterOption">
|
||||
<template #option="{ value, label, descr, type }">
|
||||
<a-tooltip placement="right" color="#ffffff" :overlayInnerStyle="{ color:'#646a73' }">
|
||||
<template #title>
|
||||
<div v-html="getTitle(descr)"></div>
|
||||
</template>
|
||||
<div style="display: flex;justify-content: space-between;">
|
||||
<span>{{label}}</span>
|
||||
<div>
|
||||
<a-tag v-if="type && type.split(',').includes('text')" color="#E8D7C3">文本</a-tag>
|
||||
<a-tag v-if="type && type.split(',').includes('imageGen')" color="#FFEBD3">图像生成</a-tag>
|
||||
<a-tag v-if="type && type.split(',').includes('image')" color="#C3D9DC">图像分析</a-tag>
|
||||
<a-tag v-if="type && type.split(',').includes('vector')" color="#D4E0D8">向量</a-tag>
|
||||
<a-tag v-if="type && type.split(',').includes('embeddings')" color="#FFEBD3">文本嵌入</a-tag>
|
||||
</div>
|
||||
</div>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
</AutoComplete>
|
||||
</template>
|
||||
</BasicForm>
|
||||
<a-alert v-if="!modelActivate" message="模型未激活,请通过下方「保存并激活」按钮激活当前模型" type="warning" show-icon />
|
||||
</div>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane :key="2" v-if="modelParamsShow">
|
||||
<template #tab>
|
||||
<span style="display: flex">
|
||||
高级配置
|
||||
<a-tooltip title="高级配置文档">
|
||||
<a @click.stop style="color: unset" href="https://help.jeecg.com/aigc/guide/model/#32-%E9%85%8D%E7%BD%AE%E9%AB%98%E7%BA%A7%E5%8F%82%E6%95%B0" target="_blank">
|
||||
<Icon style="position:relative;left:2px;top:1px" icon="ant-design:question-circle-outlined"></Icon>
|
||||
</a>
|
||||
</a-tooltip>
|
||||
</span>
|
||||
</template>
|
||||
<AiModelSeniorForm ref="modelParamsRef" :modelParams="modelParams"></AiModelSeniorForm>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
|
||||
</div>
|
||||
<template v-if="dataIndex === 'add' || dataIndex === 'edit'" #footer>
|
||||
<a-button @click="cancel">关闭</a-button>
|
||||
<a-button @click="test" v-if="modelActivate" :loading="testLoading" type="default">测试连接</a-button>
|
||||
<a-button @click="save" type="primary" ghost="true">保存</a-button>
|
||||
<a-button @click="test(false)" v-if="!modelActivate" :loading="testLoading" type="primary" >保存并激活</a-button>
|
||||
</template>
|
||||
<template v-else #footer> </template>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { ref, reactive } from 'vue';
|
||||
import BasicModal from '@/components/Modal/src/BasicModal.vue';
|
||||
import { useModal, useModalInner } from '@/components/Modal';
|
||||
import { initDictOptions } from '@/utils/dict';
|
||||
import model from './model.json';
|
||||
import { AutoComplete } from 'ant-design-vue';
|
||||
|
||||
import BasicForm from '@/components/Form/src/BasicForm.vue';
|
||||
import { useForm } from '@/components/Form';
|
||||
import { formSchema, imageList } from '../model.data';
|
||||
import { editModel, queryById, saveModel, testConn } from '../model.api';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
const {createMessage: $message, createConfirm} = useMessage();
|
||||
import AiModelSeniorForm from './AiModelSeniorForm.vue';
|
||||
import { cloneDeep } from "lodash-es";
|
||||
export default {
|
||||
name: 'AddModelModal',
|
||||
components: {
|
||||
BasicForm,
|
||||
BasicModal,
|
||||
AiModelSeniorForm,
|
||||
AutoComplete,
|
||||
},
|
||||
emits: ['success', 'register'],
|
||||
setup(props, { emit }) {
|
||||
//ai类型数据
|
||||
const modelTypeData = ref<any>([]);
|
||||
//模型类型下拉框
|
||||
const modelTypeOption = ref<any>([]);
|
||||
//模型类型禁用状态
|
||||
const modelTypeDisabled = ref<boolean>(false);
|
||||
//模型类型
|
||||
const modelType = ref<string>('all');
|
||||
//模型供应商
|
||||
const modelTypeList = ref<any>([]);
|
||||
//list:供应商选择页面,add 添加编辑
|
||||
const dataIndex = ref<string>('list');
|
||||
//供应商名称
|
||||
const providerName = ref<string>('');
|
||||
//添加模型类型的option
|
||||
const modelTypeAddOption = ref<any>([]);
|
||||
//添加模型名称的option
|
||||
const modelNameAddOption = ref<any>([]);
|
||||
//模型数据
|
||||
const modelData = ref<any>({});
|
||||
//tab切换对应的key
|
||||
const activeKey = ref<number>(1);
|
||||
//模型参数
|
||||
const modelParams = ref<any>({});
|
||||
//是否显示模型参数
|
||||
const modelParamsShow = ref<boolean>(false);
|
||||
//模型参数ref
|
||||
const modelParamsRef = ref();
|
||||
//测试按钮loading状态
|
||||
const testLoading = ref<boolean>(false);
|
||||
//模型是否已激活
|
||||
const modelActivate = ref<boolean>(false);
|
||||
|
||||
const getImage = (name) => {
|
||||
return imageList.value[name];
|
||||
};
|
||||
//自动填充文本搜索事件
|
||||
const filterOption = (input: string, option: any)=>{
|
||||
return option.value.toUpperCase().indexOf(input.toUpperCase()) >= 0;
|
||||
}
|
||||
|
||||
//表单配置
|
||||
const [registerForm, { resetFields, setFieldsValue, validate, clearValidate }] = useForm({
|
||||
schemas: formSchema,
|
||||
showActionButtonGroup: false,
|
||||
layout: 'vertical',
|
||||
wrapperCol: { span: 24 },
|
||||
});
|
||||
|
||||
//注册modal
|
||||
const [registerModal, { closeModal, setModalProps }] = useModalInner(async (data) => {
|
||||
activeKey.value = 1;
|
||||
modelParamsShow.value = false;
|
||||
if(dataIndex.value !== 'list') {
|
||||
//重置表单
|
||||
await resetFields();
|
||||
}
|
||||
setModalProps({ minHeight: 500 });
|
||||
if (data.id) {
|
||||
dataIndex.value = 'edit';
|
||||
let values = await queryById({ id: data.id });
|
||||
if (values) {
|
||||
if(values.result.credential){
|
||||
let credential = JSON.parse(values.result.credential);
|
||||
if(credential.secretKey){
|
||||
values.result.secretKey = credential.secretKey;
|
||||
}
|
||||
if(credential.apiKey){
|
||||
values.result.apiKey = credential.apiKey;
|
||||
}
|
||||
}
|
||||
let provider = values.result.provider;
|
||||
let data = model.data.filter((item) => {
|
||||
return item.value.includes(provider);
|
||||
});
|
||||
if (data && data.length > 0) {
|
||||
modelTypeAddOption.value = data[0].type;
|
||||
modelNameAddOption.value = data[0][values.result.modelType];
|
||||
}
|
||||
if(values.result.modelType && values.result.modelType === 'LLM'){
|
||||
modelParamsShow.value = true;
|
||||
}
|
||||
if (values.result.activateFlag) {
|
||||
modelActivate.value = true;
|
||||
}else{
|
||||
modelActivate.value = false;
|
||||
}
|
||||
if(values.result.modelParams){
|
||||
modelParams.value = JSON.parse(values.result.modelParams)
|
||||
}
|
||||
modelTypeDisabled.value = true;
|
||||
//表单赋值
|
||||
await setFieldsValue({
|
||||
...values.result,
|
||||
});
|
||||
//初始化模型提供者
|
||||
initModelProvider();
|
||||
}
|
||||
} else {
|
||||
modelTypeDisabled.value = false;
|
||||
//初始化模型提供者
|
||||
initModelProvider();
|
||||
dataIndex.value = 'list';
|
||||
modelNameAddOption.value = [];
|
||||
modelActivate.value = false;
|
||||
}
|
||||
});
|
||||
|
||||
//初始化模型类型
|
||||
initModelTypeOption();
|
||||
|
||||
/**
|
||||
* 初始化 模型类型字典
|
||||
*/
|
||||
function initModelTypeOption() {
|
||||
initDictOptions('model_type').then((data) => {
|
||||
modelTypeOption.value = cloneDeep(data);
|
||||
//update-begin---author:wangshuai---date:2025-03-04---for: 解决页面tab刷新一次就多一个全部类型的选项---
|
||||
if(data[0].value != 'all'){
|
||||
modelTypeOption.value.unshift({
|
||||
text: '全部类型',
|
||||
value: 'all',
|
||||
});
|
||||
}
|
||||
//update-end---author:wangshuai---date:2025-03-04---for: 解决页面tab刷新一次就多一个全部类型的选项---
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉框值选中事件
|
||||
* @param value
|
||||
*/
|
||||
function handleChange(value) {
|
||||
if ('all' == value) {
|
||||
modelTypeList.value = model.data;
|
||||
return;
|
||||
}
|
||||
let data = model.data.filter((item) => {
|
||||
return item.type.includes(value);
|
||||
});
|
||||
modelTypeList.value = data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化模型提供者
|
||||
*/
|
||||
function initModelProvider() {
|
||||
modelTypeList.value = model.data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 供应商点击事件
|
||||
*
|
||||
* @param item
|
||||
*/
|
||||
function handleClick(item) {
|
||||
dataIndex.value = 'add';
|
||||
modelData.value = item;
|
||||
providerName.value = item.title;
|
||||
modelTypeAddOption.value = item.type;
|
||||
setTimeout(()=>{
|
||||
setFieldsValue({ 'provider': item.value, 'baseUrl': item.baseUrl })
|
||||
},100)
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*/
|
||||
async function save() {
|
||||
try {
|
||||
setModalProps({ confirmLoading: true });
|
||||
let values = await validate();
|
||||
let credential = {
|
||||
apiKey: values.apiKey,
|
||||
secretKey: values.secretKey
|
||||
}
|
||||
if(modelParamsRef.value){
|
||||
let modelParams = modelParamsRef.value.emitChange();
|
||||
if(modelParams){
|
||||
values.modelParams = JSON.stringify(modelParams);
|
||||
}
|
||||
}
|
||||
if(modelActivate.value){
|
||||
values.activateFlag = 1
|
||||
}else{
|
||||
values.activateFlag = 0;
|
||||
}
|
||||
values.credential = JSON.stringify(credential);
|
||||
//新增
|
||||
if (!values.id) {
|
||||
values.provider = modelData.value.value;
|
||||
await saveModel(values);
|
||||
closeModal();
|
||||
emit('success');
|
||||
} else {
|
||||
await editModel(values);
|
||||
closeModal();
|
||||
emit('success');
|
||||
}
|
||||
}catch(e){
|
||||
if(e.hasOwnProperty('errorFields')){
|
||||
activeKey.value = 1;
|
||||
}
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消
|
||||
*/
|
||||
function cancel() {
|
||||
dataIndex.value = 'list';
|
||||
closeModal();
|
||||
emit('success');
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试连接
|
||||
*/
|
||||
async function test(onlyTest = false) {
|
||||
try {
|
||||
testLoading.value = true;
|
||||
let values = await validate();
|
||||
let credential = {
|
||||
apiKey: values.apiKey,
|
||||
secretKey: values.secretKey,
|
||||
};
|
||||
if (modelParamsRef.value) {
|
||||
let modelParams = modelParamsRef.value.emitChange();
|
||||
if (modelParams) {
|
||||
values.modelParams = JSON.stringify(modelParams);
|
||||
}
|
||||
}
|
||||
values.credential = JSON.stringify(credential);
|
||||
if (!values.provider) {
|
||||
values.provider = modelData.value.value;
|
||||
}
|
||||
//测试
|
||||
await testConn(values).then(async (result) => {
|
||||
if(onlyTest){
|
||||
$message.success('测试连接成功');
|
||||
return true;
|
||||
}
|
||||
modelActivate.value = true;
|
||||
await save();
|
||||
});
|
||||
} catch (e) {
|
||||
if (e.hasOwnProperty('errorFields')) {
|
||||
activeKey.value = 1;
|
||||
}
|
||||
} finally {
|
||||
testLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 模型类型选择事件
|
||||
* @param value
|
||||
*/
|
||||
async function handleModelTypeChange(value) {
|
||||
await setFieldsValue({ modelName: '' });
|
||||
await clearValidate('modelName');
|
||||
await setFieldsValue({
|
||||
modelName: modelData.value[value+'DefaultValue']
|
||||
})
|
||||
modelNameAddOption.value = modelData.value[value];
|
||||
if(value === 'LLM'){
|
||||
modelParamsShow.value = true;
|
||||
}else{
|
||||
modelParamsShow.value = false;
|
||||
}
|
||||
if(value === "IMAGE" && modelData.value.baseImageUrl){
|
||||
setFieldsValue({ 'baseUrl': modelData.value.baseImageUrl })
|
||||
} else if(modelData.value.baseUrl) {
|
||||
setFieldsValue({ 'baseUrl': modelData.value.baseUrl })
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 选择供应商
|
||||
*/
|
||||
function goToList() {
|
||||
if (dataIndex.value === 'add') {
|
||||
dataIndex.value = 'list';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取标题
|
||||
* @param title
|
||||
*/
|
||||
function getTitle(title) {
|
||||
if(!title){
|
||||
return "暂无描述内容";
|
||||
}
|
||||
return title.replaceAll("\n","<br>")
|
||||
}
|
||||
|
||||
return {
|
||||
registerModal,
|
||||
modelTypeData,
|
||||
modelTypeOption,
|
||||
modelType,
|
||||
handleChange,
|
||||
modelTypeList,
|
||||
getImage,
|
||||
handleClick,
|
||||
dataIndex,
|
||||
providerName,
|
||||
save,
|
||||
cancel,
|
||||
registerForm,
|
||||
handleModelTypeChange,
|
||||
modelTypeAddOption,
|
||||
modelNameAddOption,
|
||||
goToList,
|
||||
modelTypeDisabled,
|
||||
activeKey,
|
||||
modelParams,
|
||||
modelParamsShow,
|
||||
modelActivate,
|
||||
modelParamsRef,
|
||||
filterOption,
|
||||
getTitle,
|
||||
test,
|
||||
testLoading,
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.modal {
|
||||
padding: 12px 20px 20px 20px;
|
||||
.header {
|
||||
padding: 0 24px 24px 0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.header-title {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.header-select {
|
||||
margin-right: 10px;
|
||||
}
|
||||
.add-header-title {
|
||||
color: #646a73;
|
||||
}
|
||||
}
|
||||
.model-content {
|
||||
.model-header {
|
||||
position: relative;
|
||||
font-size: 14px;
|
||||
.header-img {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
margin-right: 12px;
|
||||
}
|
||||
.header-text {
|
||||
width: calc(100% - 80px);
|
||||
overflow: hidden;
|
||||
align-content: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
.model-card {
|
||||
margin-right: 10px;
|
||||
margin-bottom: 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
:deep(.ant-card .ant-card-body) {
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.pointer {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
:deep(.jeecg-basic-modal-close){
|
||||
span{
|
||||
margin-left: 0 !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style lang="less">
|
||||
.ai-model-modal{
|
||||
.jeecg-basic-modal-close > span{
|
||||
margin-left: 0 !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,393 @@
|
||||
<template>
|
||||
<div class="model-params-popover">
|
||||
<div class="params" v-if="type === 'model'">
|
||||
<span style="font-size:14px">参数</span>
|
||||
<a-select value="加载预设" style="width: 96px" size="small" @change="onLoadPreset">
|
||||
<a-select-option v-for="(preset, idx) of presets" :value="idx" :key="idx">
|
||||
<a-space>
|
||||
<Icon :icon="preset.icon" />
|
||||
<span>{{ preset.name }}</span>
|
||||
</a-space>
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</div>
|
||||
<!-- 模型温度 -->
|
||||
<div class="setting-item" v-if="type === 'model'">
|
||||
<div class="label">
|
||||
<span>模型温度</span>
|
||||
<a-tooltip :title="tips.temperature">
|
||||
<Icon icon="ant-design:question-circle" />
|
||||
</a-tooltip>
|
||||
</div>
|
||||
<a-space>
|
||||
<a-switch v-model:checked="temperatureEnable" size="small"/>
|
||||
<a-slider v-bind="temperatureProps" v-model:value="model.temperature" :disabled="model['temperature'] === null"/>
|
||||
<a-input-number v-bind="temperatureProps" v-model:value="model.temperature" :disabled="model['temperature'] === null"/>
|
||||
</a-space>
|
||||
</div>
|
||||
<!-- 词汇属性 -->
|
||||
<div class="setting-item" v-if="type === 'model'">
|
||||
<div class="label">
|
||||
<span>词汇属性</span>
|
||||
<a-tooltip :title="tips.topP">
|
||||
<Icon icon="ant-design:question-circle" />
|
||||
</a-tooltip>
|
||||
</div>
|
||||
<a-space>
|
||||
<a-switch v-model:checked="topPEnable" size="small"/>
|
||||
<a-slider v-bind="topPProps" v-model:value="model.topP" :disabled="model['topP'] === null"/>
|
||||
<a-input-number v-bind="topPProps" v-model:value="model.topP" :disabled="model['topP'] === null"/>
|
||||
</a-space>
|
||||
</div>
|
||||
<!-- 话题属性 -->
|
||||
<div class="setting-item" v-if="type === 'model'">
|
||||
<div class="label">
|
||||
<span>话题属性</span>
|
||||
<a-tooltip :title="tips.presencePenalty">
|
||||
<Icon icon="ant-design:question-circle" />
|
||||
</a-tooltip>
|
||||
</div>
|
||||
<a-space>
|
||||
<a-switch v-model:checked="presencePenaltyEnable" size="small" />
|
||||
<a-slider v-bind="presencePenaltyProps" v-model:value="model.presencePenalty" :disabled="model['presencePenalty'] === null"/>
|
||||
<a-input-number v-bind="presencePenaltyProps" v-model:value="model.presencePenalty" :disabled="model['presencePenalty'] === null"/>
|
||||
</a-space>
|
||||
</div>
|
||||
<!-- 重复属性 -->
|
||||
<div class="setting-item" v-if="type === 'model'">
|
||||
<div class="label">
|
||||
<span>重复属性</span>
|
||||
<a-tooltip :title="tips.frequencyPenalty">
|
||||
<Icon icon="ant-design:question-circle" />
|
||||
</a-tooltip>
|
||||
</div>
|
||||
<a-space>
|
||||
<a-switch v-model:checked="frequencyPenaltyEnable" size="small" />
|
||||
<a-slider v-bind="frequencyPenaltyProps" v-model:value="model.frequencyPenalty" :disabled="model['frequencyPenalty'] === null"/>
|
||||
<a-input-number v-bind="frequencyPenaltyProps" v-model:value="model.frequencyPenalty" :disabled="model['frequencyPenalty'] === null"/>
|
||||
</a-space>
|
||||
</div>
|
||||
<!-- 最大回复 -->
|
||||
<div class="setting-item" v-if="type === 'model'">
|
||||
<div class="label">
|
||||
<span>最大回复</span>
|
||||
<a-tooltip :title="tips.maxTokens">
|
||||
<Icon icon="ant-design:question-circle" />
|
||||
</a-tooltip>
|
||||
</div>
|
||||
<a-space>
|
||||
<a-switch v-model:checked="maxTokensEnable" size="small" />
|
||||
<a-slider v-bind="maxTokensProps" v-model:value="model.maxTokens" :disabled="model['maxTokens'] === null"/>
|
||||
<a-input-number v-bind="maxTokensProps" v-model:value="model.maxTokens" :disabled="model['maxTokens'] === null"/>
|
||||
</a-space>
|
||||
</div>
|
||||
<!-- timeout 超时 -->
|
||||
<div class="setting-item" v-if="type === 'model'">
|
||||
<div class="label">
|
||||
<span>超时时间</span>
|
||||
<a-tooltip :title="tips.timeout">
|
||||
<Icon icon="ant-design:question-circle" />
|
||||
</a-tooltip>
|
||||
</div>
|
||||
<a-space>
|
||||
<a-switch v-model:checked="timeoutEnable" size="small" />
|
||||
<a-slider v-bind="timeoutProps" v-model:value="model.timeout" :disabled="model['timeout'] === null"/>
|
||||
<a-input-number v-bind="timeoutProps" v-model:value="model.timeout" :disabled="model['timeout'] === null"/>
|
||||
</a-space>
|
||||
</div>
|
||||
<!-- top k -->
|
||||
<div class="setting-item" v-if="type === 'knowledge'">
|
||||
<div class="label">
|
||||
<span>Top K</span>
|
||||
<a-tooltip :title="tips.topNumber">
|
||||
<Icon icon="ant-design:question-circle" />
|
||||
</a-tooltip>
|
||||
</div>
|
||||
<a-space>
|
||||
<a-switch v-model:checked="topNumberEnable" size="small" />
|
||||
<a-slider v-bind="topNumberProps" v-model:value="model.topNumber" :disabled="model['topNumber'] === null"/>
|
||||
<a-input-number v-bind="topNumberProps" v-model:value="model.topNumber" :disabled="model['topNumber'] === null"/>
|
||||
</a-space>
|
||||
</div>
|
||||
<!-- Score 阈值 -->
|
||||
<div class="setting-item" v-if="type === 'knowledge'">
|
||||
<div class="label">
|
||||
<span>Score 阈值</span>
|
||||
<a-tooltip :title="tips.similarity">
|
||||
<Icon icon="ant-design:question-circle" />
|
||||
</a-tooltip>
|
||||
</div>
|
||||
<a-space>
|
||||
<a-switch v-model:checked="similarityEnable" size="small" />
|
||||
<a-slider v-bind="similarityProps" v-model:value="model.similarity" :disabled="model['similarity'] === null"/>
|
||||
<a-input-number v-bind="similarityProps" v-model:value="model.similarity" :disabled="model['similarity'] === null"/>
|
||||
</a-space>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import { cloneDeep, omit } from 'lodash-es';
|
||||
|
||||
export default {
|
||||
name: 'AiModelSeniorForm',
|
||||
components: {},
|
||||
props: {
|
||||
modelParams: {
|
||||
type: Object,
|
||||
default: {}
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: 'model'
|
||||
}
|
||||
},
|
||||
emits: ['success', 'register', 'updateModel'],
|
||||
setup(props, { emit }) {
|
||||
// 预设参数
|
||||
const presets = [
|
||||
{
|
||||
name: '创意',
|
||||
icon: 'fxemoji:star',
|
||||
params: {
|
||||
temperature: 0.8,
|
||||
topP: 0.9,
|
||||
presencePenalty: 0.1,
|
||||
frequencyPenalty: 0.1,
|
||||
maxTokens: null,
|
||||
timeout: 60,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: '平衡',
|
||||
icon: 'noto:balance-scale',
|
||||
params: {
|
||||
temperature: 0.5,
|
||||
topP: 0.8,
|
||||
presencePenalty: 0.2,
|
||||
frequencyPenalty: 0.3,
|
||||
maxTokens: null,
|
||||
timeout: 60,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: '精确',
|
||||
icon: 'twemoji:direct-hit',
|
||||
params: {
|
||||
temperature: 0.2,
|
||||
topP: 0.7,
|
||||
presencePenalty: 0.5,
|
||||
frequencyPenalty: 0.5,
|
||||
maxTokens: null,
|
||||
timeout: 60,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
// 参数介绍
|
||||
const tips = {
|
||||
temperature: '值越大,回复内容越赋有多样性创造性、随机性;设为0根据事实回答,希望得到精准答案应该降低该参数;日常聊天建议0.5-0.8。',
|
||||
topP: '值越小,Ai生成的内容越单调也越容易理解;值越大,Ai回复的词汇围越大,越多样化。',
|
||||
presencePenalty: '值越大,越能够让Ai更好地控制新话题的引入,建议微调或不变。',
|
||||
frequencyPenalty: '值越大,越能够让Ai更好地避免重复之前说过的话,建议微调或不变。',
|
||||
maxTokens:
|
||||
'设置Ai最大回复内容大小,会影响返回结果的长度。普通聊天建议500-800;短文生成建议800-2000;代码生成建议2000-3600;长文生成建议4000左右(或选择长回复模型)',
|
||||
topNumber: '用于筛选与用户问题相似度最高的文本片段。系统同时会根据选用模型上下文窗口大小动态调整分段数量。',
|
||||
similarity: '用于设置文本片段筛选的相似度阅值。',
|
||||
timeout: '等待AI响应的最长时间,单位为秒。'
|
||||
};
|
||||
|
||||
// 参数:温度
|
||||
const temperatureProps = ref<any>({
|
||||
min: 0.1,
|
||||
max: 1,
|
||||
step: 0.1,
|
||||
});
|
||||
|
||||
// 参数:词汇属性
|
||||
const topPProps = ref<any>({
|
||||
min: 0.1,
|
||||
max: 1,
|
||||
step: 0.1,
|
||||
});
|
||||
// 参数:话题属性
|
||||
const presencePenaltyProps = ref<any>({
|
||||
min: -2,
|
||||
max: 2,
|
||||
step: 0.1,
|
||||
});
|
||||
// 参数:重复属性
|
||||
const frequencyPenaltyProps = ref<any>({
|
||||
min: -2,
|
||||
max: 2,
|
||||
step: 0.1,
|
||||
});
|
||||
// 参数:最大回复
|
||||
const maxTokensProps = ref<any>({
|
||||
min: 1,
|
||||
max: 16000,
|
||||
step: 1,
|
||||
});
|
||||
|
||||
// 参数:topk
|
||||
const topNumberProps = ref<any>({
|
||||
min: 1,
|
||||
max: 10,
|
||||
step: 1,
|
||||
});
|
||||
|
||||
// 参数:Score 阈值
|
||||
const similarityProps = ref<any>({
|
||||
min: 0.1,
|
||||
max: 1,
|
||||
step: 0.1,
|
||||
});
|
||||
|
||||
//参数:超时时间
|
||||
const timeoutProps = ref<any>({
|
||||
min: 1,
|
||||
step: 1,
|
||||
max: 3600,
|
||||
})
|
||||
|
||||
|
||||
//参数对象
|
||||
const model = ref<any>(props.modelParams || {})
|
||||
|
||||
//模型温度是否勾选
|
||||
const temperatureEnable = computed({
|
||||
get:()=> model.value.temperature != null,
|
||||
set:(value) => model.value.temperature = !value? null: 0.7
|
||||
});
|
||||
|
||||
//词汇属性是否勾选
|
||||
const topPEnable = computed({
|
||||
get:()=> model.value.topP != null,
|
||||
set:(value) => model.value.topP = !value? null: 0
|
||||
});
|
||||
|
||||
//词汇属性是否勾选
|
||||
const presencePenaltyEnable = computed({
|
||||
get:()=> model.value.presencePenalty != null,
|
||||
set:(value) => model.value.presencePenalty = !value? null: 0
|
||||
});
|
||||
|
||||
//重复属性是否勾选
|
||||
const frequencyPenaltyEnable = computed({
|
||||
get:()=> model.value.frequencyPenalty != null,
|
||||
set:(value) => model.value.frequencyPenalty = !value? null: 0
|
||||
});
|
||||
|
||||
//最大回复
|
||||
const maxTokensEnable = computed({
|
||||
get:()=> model.value.maxTokens != null,
|
||||
set:(value) => model.value.maxTokens = !value? null: 520
|
||||
});
|
||||
|
||||
//top k
|
||||
const topNumberEnable = computed({
|
||||
get:()=> model.value.topNumber != null,
|
||||
set:(value) => model.value.topNumber = !value? null: 4
|
||||
});
|
||||
|
||||
//Score 阈值
|
||||
const similarityEnable = computed({
|
||||
get:()=> model.value.similarity != null,
|
||||
set:(value) => model.value.similarity = !value? null: 0.74
|
||||
});
|
||||
|
||||
//timeout超时时间
|
||||
const timeoutEnable = computed({
|
||||
get:()=> model.value.timeout != null,
|
||||
set:(value) => model.value.timeout = !value? null: 60
|
||||
});
|
||||
|
||||
// 加载预设
|
||||
function onLoadPreset(idx: number) {
|
||||
const preset = presets[idx];
|
||||
if (!preset) {
|
||||
return;
|
||||
}
|
||||
model.value = preset.params;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新参数
|
||||
*
|
||||
* @param model
|
||||
*/
|
||||
function emitChange() {
|
||||
return model.value;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置modal值
|
||||
* @param values
|
||||
*/
|
||||
function setModalParams(values){
|
||||
model.value = values
|
||||
}
|
||||
|
||||
return {
|
||||
presets,
|
||||
onLoadPreset,
|
||||
tips,
|
||||
temperatureProps,
|
||||
topPProps,
|
||||
presencePenaltyProps,
|
||||
model,
|
||||
frequencyPenaltyProps,
|
||||
temperatureEnable,
|
||||
maxTokensProps,
|
||||
emitChange,
|
||||
topPEnable,
|
||||
presencePenaltyEnable,
|
||||
frequencyPenaltyEnable,
|
||||
maxTokensEnable,
|
||||
topNumberEnable,
|
||||
topNumberProps,
|
||||
similarityEnable,
|
||||
similarityProps,
|
||||
setModalParams,
|
||||
timeoutEnable,
|
||||
timeoutProps,
|
||||
};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.model-params-popover {
|
||||
font-size: 14px;
|
||||
width: 100%;
|
||||
.params{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.setting-item{
|
||||
margin-top: 10px;
|
||||
}
|
||||
.setting-item .label {
|
||||
> span {
|
||||
vertical-align: middle;
|
||||
|
||||
&.app-iconify {
|
||||
cursor: help;
|
||||
color: #888888;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.ant-space {
|
||||
.ant-slider {
|
||||
width: 380px;
|
||||
}
|
||||
|
||||
.ant-input-number {
|
||||
width: 110px;
|
||||
min-width: 80px;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,186 @@
|
||||
{
|
||||
"data": [
|
||||
{
|
||||
"title": "Anthropic",
|
||||
"value": "ANTHROPIC",
|
||||
"LLM": [
|
||||
{"label": "claude-sonnet-4-20250514", "value": "claude-sonnet-4-20250514","descr": "【Claude 4系列】Claude Sonnet 4具有卓越推理能力的高性能模型。\n\n支持文本和图像输入,文本输出,拥有200k上下文窗口(1M上下文测试版可用)。","type": "text,image"},
|
||||
{"label": "claude-opus-4-20250514", "value": "claude-opus-4-20250514","descr": "【Claude 4系列】Claude Opus 4是最强大、最有能力的模型。\n\n支持文本和图像输入,文本输出,拥有200k上下文窗口,卓越的推理能力。","type": "text,image"},
|
||||
{"label": "claude-3-7-sonnet-20250219", "value": "claude-3-7-sonnet-20250219","descr": "【Claude 3.7系列】Claude Sonnet 3.7中型模型,具备卓越的推理能力和效率。\n\n适合企业工作负载和大规模AI部署。","type": "text,image"},
|
||||
{"label": "claude-3-5-sonnet-20241022", "value": "claude-3-5-sonnet-20241022","descr": "Claude 3.5 Sonnet是Anthropic最强大的AI模型。\n\n在编程、多步骤工作流、图表解释等复杂任务中表现出色。支持200k上下文长度,支持8k最大输出。","type": "text,image"},
|
||||
{"label": "claude-3-5-haiku-20241022", "value": "claude-3-5-haiku-20241022","descr": "【快速模型】Claude 3.5 Haiku是Anthropic最快的AI模型。\n\n响应速度快,成本较低,适合高频交互场景。支持200k上下文长度,支持8k最大输出。","type": "text,image"},
|
||||
{"label": "claude-3-opus-20240229", "value": "claude-3-opus-20240229","descr": "Claude 3 Opus是Claude 3系列中性能最强的模型。\n\n在高度复杂的任务上表现出色,如编写高质量代码、数学推理等。支持200k上下文长度,支持4k最大输出。","type": "text,image"},
|
||||
{"label": "claude-3-sonnet-20240229", "value": "claude-3-sonnet-20240229","descr": "Claude 3 Sonnet在智能和速度之间取得了良好平衡。\n\n适合企业工作负载和大规模AI部署。支持200k上下文长度,支持4k最大输出。","type": "text,image"},
|
||||
{"label": "claude-3-haiku-20240307", "value": "claude-3-haiku-20240307","descr": "Claude 3 Haiku是Claude 3系列中最快的模型。\n\n提供接近即时的响应,适合无缝AI体验。支持200k上下文长度,支持4k最大输出。","type": "text,image"}
|
||||
],
|
||||
"type": ["LLM"],
|
||||
"baseUrl": "https://api.anthropic.com/v1",
|
||||
"LLMDefaultValue": "claude-3-5-sonnet-20241022"
|
||||
},
|
||||
{
|
||||
"title": "DeepSeek",
|
||||
"value": "DEEPSEEK",
|
||||
"LLM": [
|
||||
{"label": "deepseek-reasoner", "value": "deepseek-reasoner","descr": "【官方模型】深度求索 新推出的推理模型R1满血版\n火便全球。\n支持64k上下文,其中支持8k最大回复。","type": "text"},
|
||||
{"label":"deepseek-chat", "value": "deepseek-chat","descr": "最强开源 MoE 模型 DeepSeek-V3,全球首个在代码、数学能力上与GPT-4-Turbo争锋的模型,在代码、数学的多个榜单上位居全球第二;","type": "text"}
|
||||
],
|
||||
"type": ["LLM"],
|
||||
"baseUrl": "https://api.deepseek.com/v1",
|
||||
"LLMDefaultValue": "deepseek-chat"
|
||||
},
|
||||
{
|
||||
"title": "Ollama",
|
||||
"value": "OLLAMA",
|
||||
"LLM": [
|
||||
{"label": "llama2", "value": "llama2"},
|
||||
{"label": "llama2:13b", "value": "llama2:13b"},
|
||||
{"label": "llama2:70b", "value": "llama2:70b"},
|
||||
{"label": "llama2-chinese:13b", "value": "llama2-chinese:13b"},
|
||||
{"label": "llama3:8b", "value": "llama3:8b"},
|
||||
{"label": "llama3:70b", "value": "llama3:70b"},
|
||||
{"label": "qwen:0.5b", "value": "qwen:0.5b"},
|
||||
{"label": "qwen:1.8b", "value": "qwen:1.8b"},
|
||||
{"label": "qwen:4b", "value": "qwen:4b"},
|
||||
{"label": "qwen:7b", "value": "qwen:7b"},
|
||||
{"label": "qwen:14b", "value": "qwen:14b"},
|
||||
{"label": "qwen:32b", "value": "qwen:32b"},
|
||||
{"label": "qwen:72b", "value": "qwen:72b"},
|
||||
{"label": "qwen:110b", "value": "qwen:110b"},
|
||||
{"label": "qwen2:72b-instruct", "value": "qwen2:72b-instruct"},
|
||||
{"label": "qwen2:57b-a14b-instruct", "value": "qwen2:57b-a14b-instruct"},
|
||||
{"label": "qwen2:7b-instruct", "value": "qwen2:7b-instruct"},
|
||||
{"label": "qwen2.5:72b-instruct", "value": "qwen2.5:72b-instruct"},
|
||||
{"label": "qwen2.5:32b-instruct", "value": "qwen2.5:32b-instruct"},
|
||||
{"label": "qwen2.5:14b-instruct", "value": "qwen2.5:14b-instruct"},
|
||||
{"label": "qwen2.5:7b-instruct", "value": "qwen2.5:7b-instruct"},
|
||||
{"label": "qwen2.5:1.5b-instruct", "value": "qwen2.5:1.5b-instruct"},
|
||||
{"label": "qwen2.5:0.5b-instruct", "value": "qwen2.5:0.5b-instruct"},
|
||||
{"label": "qwen2.5:3b-instruct", "value": "qwen2.5:3b-instruct"},
|
||||
{"label": "phi3", "value": "phi3"}
|
||||
],
|
||||
"EMBED": [
|
||||
{"label": "nomic-embed-text", "value": "nomic-embed-text"}
|
||||
],
|
||||
"type": ["LLM", "EMBED"],
|
||||
"baseUrl": "http://localhost:11434",
|
||||
"LLMDefaultValue": "llama2",
|
||||
"EMBEDDefaultValue": "nomic-embed-text"
|
||||
},
|
||||
{
|
||||
"title": "OpenAI",
|
||||
"value": "OPENAI",
|
||||
"LLM": [
|
||||
{"label": "gpt-3.5-turbo", "value": "gpt-3.5-turbo","descr": "纯官方高速GPT3.5系列,目前指向gpt-35-turbo-0125模型,最大回复小于4k。\n综合能力强,过去使用最广泛的文本模型。", "type": "text"
|
||||
},
|
||||
{"label": "gpt-4", "value": "gpt-4","descr": "纯官方GPT4系列。知识库截止于2021年,价格适中,具有中等参数,比gpt-4turbo系列略强。","type": "text"},
|
||||
{"label": "gpt-4o", "value": "gpt-4o","descr": "GPT-4o,是openai的新旗舰型号,支持文本和图片分析。\n\n是迈向更自然的人机交互的一步——它接受文本和图像的任意组合作为输入,并生成文本和图像输出的任意组合。","type": "text,image"},
|
||||
{"label": "gpt-4o-mini", "value": "gpt-4o-mini","descr": "GPT-4o mini是目前性价比最高的小参数模型,性能介于GPT3.5~GPT4o之间。\n\n成本相比GPT-3.5 Turbo便宜60%以上,支持50种不同语言,用于替代GPT-3.5版本的模型。\n\n4o-mini的图像分析价格和4o差不多,如果有图像分析需求还是4o更好一些。\n\n当前指向 gpt-4o-mini-2024-07-18","type": "text,image"},
|
||||
{"label": "gpt-4-turbo", "value": "gpt-4-turbo","descr": "纯官方GPT4系列,支持文本和图片分析,最大回复4k,openai于2024-4-9新增的模型,知识库更新于2023年12月。提高了写作、数学、逻辑推理和编码能力。当前指向gpt-4-turbo-2024-04-09","type": "text,image"},
|
||||
{"label": "gpt-4-turbo-preview", "value": "gpt-4-turbo-preview","descr": "纯官方GPT4系列,最大回复4k,知识库更新于2023年4月。当前指向gpt-4-0125-preview","type": "text"},
|
||||
{"label": "gpt-3.5-turbo-0125", "value": "gpt-3.5-turbo-0125","descr": "openai于2024年1月25号更新的gpt-3.5模型,最大回复4k。\n\n综合能力强,过去使用最广泛的文本模型。","type": "text"},
|
||||
{"label": "gpt-3.5-turbo-1106", "value": "gpt-3.5-turbo-1106","descr": "openai于2023年11月6号更新的gpt-3.5模型,最大回复4k。属于即将被淘汰的模型。\n\n建议使用gpt-3.5-turbo或gpt-4o-mini","type": "text"},
|
||||
{"label": "gpt-3.5-turbo-0613", "value": "gpt-3.5-turbo-0613","descr": "通过微调后可以更准确地按照用户的指示进行操作,生成更简洁和针对性的输出。它不仅可以用于文本生成,还可以通过函数调用功能与其他系统和API进行集成,实现更复杂的任务自动化","type": "text"},
|
||||
{"label": "gpt-4o-2024-05-13", "value": "gpt-4o-2024-05-13","descr": "GPT-4o,是openai的新旗舰型号,支持文本和图片分析。\n\n是迈向更自然的人机交互的一步——它接受文本和图像的任意组合作为输入,并生成文本和图像输出的任意组合。\n\n该模型为初代的4o模型","type": "text,image"},
|
||||
{"label": "gpt-4-turbo-2024-04-09", "value": "gpt-4-turbo-2024-04-09","descr": "纯官方GPT4系列,支持文本和图片分析,最大回复4k,openai于2024-4-9新增的模型,提高了写作、数学、逻辑推理和编码能力。知识库更新于2023年12月。","type": "text,image"},
|
||||
{"label": "gpt-4-0125-preview", "value": "gpt-4-0125-preview","descr": "纯官方GPT4系列,最大回复4k,知识库更新于2023年4月。当前与gpt-4-turbo-preview属于同一模型","type": "text"},
|
||||
{"label": "gpt-4-1106-preview", "value": "gpt-4-1106-preview","descr": "纯官方GPT4系列,最大回复4k,知识库更新于2023年4月。正在逐渐被新的模型gpt-4-turbo和gpt-4-turbo-preview取代。","type": "text"}
|
||||
],
|
||||
"EMBED": [
|
||||
{"label": "text-embedding-ada-002", "value": "text-embedding-ada-002","descr": "用于生成文本嵌入的模型。文本嵌入是将文本转换为数值形式(通常是向量),以便可以用于机器学习模型。","type": "vector,embeddings"},
|
||||
{"label": "text-embedding-3-small", "value": "text-embedding-3-small","descr": "用于生成文本的嵌入表示,网络结构较小,计算资源需求较低。虽然可能不如\"large\"版本那样精准,但它更适合于资源受限的环境或需要更快速处理的任务。","type": "vector,embeddings"},
|
||||
{"label": "text-embedding-3-large", "value": "text-embedding-3-large","descr": "用于生成文本的嵌入表示,即将文本转换为高维空间中的点,这些点的距离可以表示文本之间的相似度。有较大的网络结构,能够捕捉更丰富的语言特征,适用于需要高质量文本相似度或分类任务的场景。","type": "vector,embeddings"}
|
||||
],
|
||||
"IMAGE": [
|
||||
{"label": "gpt-image-1.5", "value": "gpt-image-1.5","descr": "openAI强大的图片生成模型,支持图像生成与编辑功能,生图图片支持中文文字。相比上一版本,拥有更好的指令跟踪和对提示词的遵循。","type": "imageGen"},
|
||||
{"label": "gpt-image-1", "value": "gpt-image-1","descr": "是一个图片生成模型,支持图像生成与编辑功能,生图图片支持中文文字。","type": "imageGen"},
|
||||
{"label": "dall-e-2", "value": "dall-e-2","descr": "是OpenAI推出的文本生成图像系统","type": "imageGen"},
|
||||
{"label": "dall-e-3", "value": "dall-e-3","descr": "是OpenAI开发的第三代文本到图像生成模型,提升了图像细节处理和艺术风格迁移能力","type": "imageGen"}
|
||||
],
|
||||
"type": ["LLM", "EMBED","IMAGE"],
|
||||
"baseUrl": "https://api.openai.com/v1/",
|
||||
"LLMDefaultValue": "gpt-4o-mini",
|
||||
"EMBEDDefaultValue": "text-embedding-ada-002",
|
||||
"IMAGEDefaultValue": "gpt-image-1.5"
|
||||
},
|
||||
{
|
||||
"title": "通义千问",
|
||||
"value": "QWEN",
|
||||
"LLM": [
|
||||
{"label": "qwen-turbo", "value": "qwen-turbo","descr": "通义千问超大规模语言模型,支持中文、英文等不同语言输入。适合文本创作、文本处理、编程辅助、翻译服务、对话模拟。","type": "text"},
|
||||
{"label": "qwen-plus", "value": "qwen-plus","descr": "通义千问超大规模语言模型,支持中文、英文等不同语言输入。适合文本创作、文本处理、编程辅助、翻译服务、对话模拟。","type": "text"},
|
||||
{"label": "qwen-max", "value": "qwen-max","descr": "暂无描述内容!","type": "text"}
|
||||
],
|
||||
"EMBED": [
|
||||
{"label": "text-embedding-v2", "value": "text-embedding-v2","descr": "是一种将文本数据转换为向量的技术,通过深度学习模型将文本的语义信息嵌入到高维向量空间中。这些向量不仅能表达文本内容,还能捕捉文本之间的相似性和关系,从而让计算机高效地进行文本检索、分类、聚类等任务。","type": "vector"}
|
||||
],
|
||||
"IMAGE": [
|
||||
{ "label": "wan2.2-t2i-plus", "value": "wan2.2-t2i-plus","descr": "全新升级的通义万相2.2文生图,更快的生成速度。在生成图像创意性、稳定性、写实质感方面全面升级,指令遵循更强,原生支持多种风格。支持最大200万像素生成,支持智能提示词改写等。","type": "imageGen"},
|
||||
{ "label": "wan2.2-t2i-flash", "value": "wan2.2-t2i-flash","descr": "全新升级的通义万相2.2文生图,更快的生成速度。在生成图像创意性、稳定性、写实质感方面全面升级,指令遵循更强,原生支持多种风格。支持最大200万像素生成,支持智能提示词改写等。","type": "imageGen"},
|
||||
{ "label": "wan2.5-i2i-preview", "value": "wan2.5-i2i-preview","descr": "是万相2.5系列中的图像编辑模型,专注于通用图像编辑任务,支持单图编辑和多图融合功能","type": "imageGen"},
|
||||
{ "label": "wanx2.1-imageedit", "value": "wanx2.1-imageedit","descr": "是阿里云百炼平台提供的通用图像编辑模型,适用于多种图像处理任务,如风格迁移、内容编辑、尺寸优化等","type": "imageGen"},
|
||||
{ "label": "wanx-v1", "value": "wanx-v1","descr": "是通义万相系列中的文本生成图像模型,支持中英文双语输入和多种图像风格生成","type": "imageGen"}
|
||||
],
|
||||
"type": ["LLM", "EMBED","IMAGE"],
|
||||
"baseUrl": "https://dashscope.aliyuncs.com/api/v1/services/",
|
||||
"baseImageUrl": "https://dashscope.aliyuncs.com/api/v1/",
|
||||
"LLMDefaultValue": "qwen-plus",
|
||||
"EMBEDDefaultValue": "text-embedding-v2",
|
||||
"IMAGEDefaultValue": "wan2.2-t2i-plus"
|
||||
},
|
||||
{
|
||||
"title": "千帆大模型",
|
||||
"value": "QIANFAN",
|
||||
"LLM": [
|
||||
{"label": "ERNIE-Bot", "value": "ERNIE-Bot","descr": "是百度推出的一款知识增强大语言模型,主要用于与人对话互动、回答问题、协助创作,帮助人们高效便捷地获取信息、知识和灵感","type": "text"},
|
||||
{"label": "ERNIE-Bot 4.0", "value": "ERNIE-Bot 4.0","descr": "百度自行研发的文心产业级知识增强大语言模型4.0版本\n\n实现了基础模型的全面升级,在理解、生成、逻辑和记忆能力上相对ERNIE 3.5都有着显著提升,支持5K输入+2K输出。","type": "text"},
|
||||
{"label": "ERNIE-Bot-8K", "value": "ERNIE-Bot-8K","descr": "主要用于数据分析场景,特别是在企业数据分析中表现出色。ERNIE-Bot-8K是百度文心大模型的一个版本,具有模型效果优、生成能力强、应用门槛低等独特优势。","type": "text"},
|
||||
{"label": "ERNIE-Bot-turbo", "value": "ERNIE-Bot-turbo","descr": "是一个大语言模型,主要用于对话问答、内容创作生成等任务。它是百度自行研发的大语言模型,覆盖了海量中文数据,具有更强的对话问答和内容创作生成能力","type": "text"},
|
||||
{"label": "ERNIE-Speed-128K", "value": "ERNIE-Speed-128K","descr": "是一款基于Transformer结构的轻量级语言模型,旨在满足实时数据处理的需求。它具有高效、低延迟和高准确性的特点,广泛应用于自然语言处理、信息检索和文本分类等领域","type": "text"},
|
||||
{"label": "EB-turbo-AppBuilder", "value": "EB-turbo-AppBuilder","descr": "主要用于企业级应用场景,如智能客服、内容创作和知识问答等任务。它是基于文心高性能大语言模型ERNIE-Bot-turbo构建的,针对企业特定需求进行了深度的场景效果优化和输出格式定制,因此在满足企业特定需求方面具有更高的灵活性和实用性","type": "text"},
|
||||
{"label": "Yi-34B-Chat", "value": "Yi-34B-Chat","descr": "Yi-34B-Chat是一款基于Transformer架构的生成式预训练语言模型,它拥有340亿个参数,使其在处理自然语言任务时表现出了强大的能力。","type": "text"},
|
||||
{"label": "BLOOMZ-7B", "value": "BLOOMZ-7B","descr": "是一个用于生成文本序列的自回归模型,它可以进行多语言处理,支持46种语言和13种编程语言。BLOOMZ-7B是BLOOM模型的一个调优版本,具有更出色的泛化和零样本学习能力,适用于多种任务和场景","type": "text"},
|
||||
{"label": "Qianfan-BLOOMZ-7B-compressed", "value": "Qianfan-BLOOMZ-7B-compressed","descr": "是千帆团队在BLOOMZ-7B基础上的压缩版本,融合量化、稀疏化等技术,显存占用降低30%以上。","type": "text"},
|
||||
{"label": "Mixtral-8x7B-Instruct", "value": "Mixtral-8x7B-Instruct","descr": "由Mistral AI发布的首个高质量稀疏专家混合模型 (MOE),模型由8个70亿参数专家模型组成,在多个基准测试中表现优于Llama-2-70B及GPT3.5,能够处理32K上下文,在代码生成任务中表现尤为优异。","type": "text"},
|
||||
{"label": "Llama-2-7b-chat", "value": "Llama-2-7b-chat","descr": "由Meta AI研发并开源,在编码、推理及知识应用等场景表现优秀,Llama-2-7b-chat是高性能原生开源版本,适用于对话场景。","type": "text"},
|
||||
{"label": "Llama-2-13b-chat", "value": "Llama-2-13b-chat","descr": "由Meta AI研发并开源,在编码、推理及知识应用等场景表现优秀,Llama-2-13b-chat是性能与效果均衡的原生开源版本,适用于对话场景。","type": "text"},
|
||||
{"label": "Llama-2-70b-chat", "value": "Llama-2-70b-chat","descr": "由Meta AI研发并开源,在编码、推理及知识应用等场景表现优秀,Llama-2-70b-chat是高精度效果的原生开源版本。","type": "text"},
|
||||
{"label": "Qianfan-Chinese-Llama-2-7B", "value": "Qianfan-Chinese-Llama-2-7B","descr": "是千帆团队在Llama-2-7b基础上的中文增强版本,在CMMLU、C-EVAL等中文数据集上表现优异。","type": "text"},
|
||||
{"label": "ChatGLM2-6B-32K", "value": "ChatGLM2-6B-32K","descr": "是在ChatGLM2-6B的基础上进一步强化了对于长文本的理解能力,能够更好的处理最多32K长度的上下文。","type": "text"},
|
||||
{"label": "AquilaChat-7B", "value": "AquilaChat-7B","descr": "是由智源研究院研发,基于Aquila-7B训练的对话模型,支持流畅的文本对话及多种语言类生成任务,通过定义可扩展的特殊指令规范,实现 AquilaChat对其它模型和工具的调用,且易于扩展。","type": "text"}
|
||||
],
|
||||
"EMBED": [
|
||||
{"label": "Embedding-V1", "value": "Embedding-V1","descr": "主要用于将离散对象(如文本、图像等)映射为连续的数值向量,以便于计算机处理和机器学习模型的训练和使用","type": "vector,embeddings"},
|
||||
{"label": "tao-8k", "value": "tao-8k","descr": "是由Huggingface开发者amu研发并开源的长文本向量表示模型,支持8k上下文长度,模型效果在C-MTEB上居前列,是当前最优的中文长文本embeddings模型之一","type": "vector"},
|
||||
{"label": "bge-large-zh", "value": "bge-large-zh","descr": "是由智源研究院研发的中文版文本表示模型,可将任意文本映射为低维稠密向量,以用于检索、分类、聚类或语义匹配等任务,并可支持为大模型调用外部知识。","type": "vector"},
|
||||
{"label": "bge-large-en", "value": "bge-large-en","descr": "是由智源研究院研发的英文版文本表示模型,可将任意文本映射为低维稠密向量,以用于检索、分类、聚类或语义匹配等任务,并可支持为大模型调用外部知识。","type": "vector"}
|
||||
],
|
||||
"type": ["LLM", "EMBED"],
|
||||
"baseUrl": "https://aip.baidubce.com",
|
||||
"LLMDefaultValue": "Yi-34B-Chat",
|
||||
"EMBEDDefaultValue": "Embedding-V1"
|
||||
},
|
||||
{
|
||||
"title": "智谱AI",
|
||||
"value": "ZHIPU",
|
||||
"LLM": [
|
||||
{"label": "glm-4", "value": "glm-4","descr": "是一个多模态大语言模型,主要用于处理复杂的指令和任务,支持长文本处理、多模态理解和文生图等功能","type": "text,image"},
|
||||
{"label": "glm-4v", "value": "glm-4v","descr": "智谱:多模态模型\n\n更懂中文的视觉理解、文生图等多模态模型能力。准确理解各任务场景语言描述及指令,更精确的完成多模态理解类任务,或生成高质量的图片、视频等多模态内容。","type": "text,image"},
|
||||
{"label": "glm-4-flash", "value": "glm-4-flash","descr": "该模型官方免费,主要用于处理多种自然语言处理任务,包括智能对话助手、辅助论文翻译、ppt及会议内容生产、网页智能搜索、数据生成和抽取、网页解析、智能规划和决策、辅助科研等场景","type": "text"},
|
||||
{"label": "glm-3-turbo", "value": "glm-3-turbo","descr": "是一种基于transformer结构的语言模型,由智谱AI推出。其主要特点包括使用三层transformer结构、采用Turbo机制以实时生成文本、处理长文本输入并具有强大的语言理解能力","type": "text"}
|
||||
],
|
||||
"EMBED": [
|
||||
{"label": "Embedding-3", "value": "Embedding-3","descr": "主要用于文本搜索、聚类、推荐等任务。它通过将文本映射到低维向量空间,使得文本之间的语义关系可以通过向量之间的距离或相似度来衡量,从而支持各种基于向量的应用。","type": "vector"},
|
||||
{"label": "Embedding-2", "value": "Embedding-2","descr": "用于将高维离散数据映射到低维连续数值向量中,以便机器学习模型能够更好地处理和理解这些数据","type": "vector"}
|
||||
],
|
||||
"IMAGE": [
|
||||
{"label": "CogView-4", "value": "CogView-4","descr": "智谱首个支持生成汉字的开源文生图模型,在语义理解、图像生成质量、中英文字生成能力等方面全面提升,支持任意长度的中英双语输入,能够生成在给定范围内的任意分辨率图像。","type": "imageGen"},
|
||||
{"label": "Cogview-3-Flash", "value": "Cogview-3-Flash","descr": "是智谱推出的免费图像生成模型,能够根据用户指令生成符合要求且美学评分更高的图像。CogView-3-Flash 主要应用于艺术创作、设计参考、游戏开发、虚拟现实等领域,帮助用户快速实现从文本到图像的转换需求。","type": "imageGen"}
|
||||
],
|
||||
"type": ["LLM", "EMBED", "IMAGE"],
|
||||
"baseUrl": "https://open.bigmodel.cn",
|
||||
"LLMDefaultValue": "glm-4-flash",
|
||||
"EMBEDDefaultValue": "Embedding-2",
|
||||
"IMAGEDefaultValue": "CogView-4"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user