|
|
@@ -24,7 +24,8 @@ import {
|
|
|
TextArea,
|
|
|
Checkbox,
|
|
|
Banner,
|
|
|
- Modal, ImagePreview
|
|
|
+ Modal,
|
|
|
+ ImagePreview,
|
|
|
} from '@douyinfe/semi-ui';
|
|
|
import { getChannelModels, loadChannelModels } from '../../components/utils.js';
|
|
|
import { IconHelpCircle } from '@douyinfe/semi-icons';
|
|
|
@@ -306,7 +307,7 @@ const EditChannel = (props) => {
|
|
|
fetchModels().then();
|
|
|
fetchGroups().then();
|
|
|
if (isEdit) {
|
|
|
- loadChannel().then(() => { });
|
|
|
+ loadChannel().then(() => {});
|
|
|
} else {
|
|
|
setInputs(originInputs);
|
|
|
let localModels = getChannelModels(inputs.type);
|
|
|
@@ -477,7 +478,9 @@ const EditChannel = (props) => {
|
|
|
type={'warning'}
|
|
|
description={
|
|
|
<>
|
|
|
- {t('2025年5月10日后添加的渠道,不需要再在部署的时候移除模型名称中的"."')}
|
|
|
+ {t(
|
|
|
+ '2025年5月10日后添加的渠道,不需要再在部署的时候移除模型名称中的"."',
|
|
|
+ )}
|
|
|
{/*<br />*/}
|
|
|
{/*<Typography.Text*/}
|
|
|
{/* style={{*/}
|
|
|
@@ -522,7 +525,7 @@ const EditChannel = (props) => {
|
|
|
<Input
|
|
|
label={t('默认 API 版本')}
|
|
|
name='azure_other'
|
|
|
- placeholder={t('请输入默认 API 版本,例如:2024-12-01-preview')}
|
|
|
+ placeholder={t('请输入默认 API 版本,例如:2025-04-01-preview')}
|
|
|
onChange={(value) => {
|
|
|
handleInputChange('other', value);
|
|
|
}}
|
|
|
@@ -584,25 +587,35 @@ const EditChannel = (props) => {
|
|
|
value={inputs.name}
|
|
|
autoComplete='new-password'
|
|
|
/>
|
|
|
- {inputs.type !== 3 && inputs.type !== 8 && inputs.type !== 22 && inputs.type !== 36 && inputs.type !== 45 && (
|
|
|
- <>
|
|
|
- <div style={{ marginTop: 10 }}>
|
|
|
- <Typography.Text strong>{t('API地址')}:</Typography.Text>
|
|
|
- </div>
|
|
|
- <Tooltip content={t('对于官方渠道,new-api已经内置地址,除非是第三方代理站点或者Azure的特殊接入地址,否则不需要填写')}>
|
|
|
- <Input
|
|
|
- label={t('API地址')}
|
|
|
- name="base_url"
|
|
|
- placeholder={t('此项可选,用于通过自定义API地址来进行 API 调用,末尾不要带/v1和/')}
|
|
|
- onChange={(value) => {
|
|
|
- handleInputChange('base_url', value);
|
|
|
- }}
|
|
|
- value={inputs.base_url}
|
|
|
- autoComplete="new-password"
|
|
|
- />
|
|
|
- </Tooltip>
|
|
|
- </>
|
|
|
- )}
|
|
|
+ {inputs.type !== 3 &&
|
|
|
+ inputs.type !== 8 &&
|
|
|
+ inputs.type !== 22 &&
|
|
|
+ inputs.type !== 36 &&
|
|
|
+ inputs.type !== 45 && (
|
|
|
+ <>
|
|
|
+ <div style={{ marginTop: 10 }}>
|
|
|
+ <Typography.Text strong>{t('API地址')}:</Typography.Text>
|
|
|
+ </div>
|
|
|
+ <Tooltip
|
|
|
+ content={t(
|
|
|
+ '对于官方渠道,new-api已经内置地址,除非是第三方代理站点或者Azure的特殊接入地址,否则不需要填写',
|
|
|
+ )}
|
|
|
+ >
|
|
|
+ <Input
|
|
|
+ label={t('API地址')}
|
|
|
+ name='base_url'
|
|
|
+ placeholder={t(
|
|
|
+ '此项可选,用于通过自定义API地址来进行 API 调用,末尾不要带/v1和/',
|
|
|
+ )}
|
|
|
+ onChange={(value) => {
|
|
|
+ handleInputChange('base_url', value);
|
|
|
+ }}
|
|
|
+ value={inputs.base_url}
|
|
|
+ autoComplete='new-password'
|
|
|
+ />
|
|
|
+ </Tooltip>
|
|
|
+ </>
|
|
|
+ )}
|
|
|
<div style={{ marginTop: 10 }}>
|
|
|
<Typography.Text strong>{t('密钥')}:</Typography.Text>
|
|
|
</div>
|
|
|
@@ -761,10 +774,10 @@ const EditChannel = (props) => {
|
|
|
name='other'
|
|
|
placeholder={t(
|
|
|
'请输入部署地区,例如:us-central1\n支持使用模型映射格式\n' +
|
|
|
- '{\n' +
|
|
|
- ' "default": "us-central1",\n' +
|
|
|
- ' "claude-3-5-sonnet-20240620": "europe-west1"\n' +
|
|
|
- '}',
|
|
|
+ '{\n' +
|
|
|
+ ' "default": "us-central1",\n' +
|
|
|
+ ' "claude-3-5-sonnet-20240620": "europe-west1"\n' +
|
|
|
+ '}',
|
|
|
)}
|
|
|
autosize={{ minRows: 2 }}
|
|
|
onChange={(value) => {
|