mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-19 22:53:41 +08:00
feat: add deployment_mapping for Azure OpenAI
This commit is contained in:
@@ -10,6 +10,11 @@ const MODEL_MAPPING_EXAMPLE = {
|
||||
'gpt-4-32k-0314': 'gpt-4-32k'
|
||||
};
|
||||
|
||||
const DEPLOYMENT_MAPPING_EXAMPLE = {
|
||||
'gpt-3.5-turbo': 'gpt-35-turbo',
|
||||
'gpt-4': 'custom-gpt4'
|
||||
};
|
||||
|
||||
function type2secretPrompt(type) {
|
||||
// inputs.type === 15 ? '按照如下格式输入:APIKey|SecretKey' : (inputs.type === 18 ? '按照如下格式输入:APPID|APISecret|APIKey' : '请输入渠道对应的鉴权密钥')
|
||||
switch (type) {
|
||||
@@ -43,6 +48,7 @@ const EditChannel = () => {
|
||||
base_url: '',
|
||||
other: '',
|
||||
model_mapping: '',
|
||||
deployment_mapping: '',
|
||||
models: [],
|
||||
groups: ['default']
|
||||
};
|
||||
@@ -396,6 +402,23 @@ const EditChannel = () => {
|
||||
autoComplete='new-password'
|
||||
/>
|
||||
</Form.Field>
|
||||
{
|
||||
inputs.type === 3 && (
|
||||
<>
|
||||
<Form.Field>
|
||||
<Form.TextArea
|
||||
label='部署映射'
|
||||
placeholder={`此项可选,为一个 JSON 字符串,键为请求中模型名称,值为要替换的部署名称,用于修改 Azure OpenAI 的 deployment 参数。如果不填此参数,则部署名称必须与模型名称一致,例如 gpt-3.5-turbo 模型对应的部署名称应该为 gpt-35-turbo。若实际的部署名称不满足此规则,则可以通过该参数自定义。例如:\n${JSON.stringify(DEPLOYMENT_MAPPING_EXAMPLE, null, 2)}`}
|
||||
name='deployment_mapping'
|
||||
onChange={handleInputChange}
|
||||
value={inputs.deployment_mapping}
|
||||
style={{ minHeight: 150, fontFamily: 'JetBrains Mono, Consolas' }}
|
||||
autoComplete='new-password'
|
||||
/>
|
||||
</Form.Field>
|
||||
</>
|
||||
)
|
||||
}
|
||||
{
|
||||
batch ? <Form.Field>
|
||||
<Form.TextArea
|
||||
|
||||
Reference in New Issue
Block a user