feat: update default API version for Azure OpenAI (#994)
* feat: Update default API version for Azure OpenAI. * chore: update other theme --------- Co-authored-by: JustSong <songquanpeng@foxmail.com>
This commit is contained in:
parent
4d86d021c4
commit
ade19ba4a2
@ -61,7 +61,7 @@ func RelayImageHelper(c *gin.Context, relayMode int) *relaymodel.ErrorWithStatus
|
|||||||
if meta.ChannelType == common.ChannelTypeAzure {
|
if meta.ChannelType == common.ChannelTypeAzure {
|
||||||
// https://learn.microsoft.com/en-us/azure/ai-services/openai/dall-e-quickstart?tabs=dalle3%2Ccommand-line&pivots=rest-api
|
// https://learn.microsoft.com/en-us/azure/ai-services/openai/dall-e-quickstart?tabs=dalle3%2Ccommand-line&pivots=rest-api
|
||||||
apiVersion := util.GetAzureAPIVersion(c)
|
apiVersion := util.GetAzureAPIVersion(c)
|
||||||
// https://{resource_name}.openai.azure.com/openai/deployments/dall-e-3/images/generations?api-version=2023-06-01-preview
|
// https://{resource_name}.openai.azure.com/openai/deployments/dall-e-3/images/generations?api-version=2024-03-01-preview
|
||||||
fullRequestURL = fmt.Sprintf("%s/openai/deployments/%s/images/generations?api-version=%s", meta.BaseURL, imageRequest.Model, apiVersion)
|
fullRequestURL = fmt.Sprintf("%s/openai/deployments/%s/images/generations?api-version=%s", meta.BaseURL, imageRequest.Model, apiVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -230,7 +230,7 @@ const EditChannel = (props) => {
|
|||||||
localInputs.base_url = localInputs.base_url.slice(0, localInputs.base_url.length - 1);
|
localInputs.base_url = localInputs.base_url.slice(0, localInputs.base_url.length - 1);
|
||||||
}
|
}
|
||||||
if (localInputs.type === 3 && localInputs.other === '') {
|
if (localInputs.type === 3 && localInputs.other === '') {
|
||||||
localInputs.other = '2023-06-01-preview';
|
localInputs.other = '2024-03-01-preview';
|
||||||
}
|
}
|
||||||
if (localInputs.type === 18 && localInputs.other === '') {
|
if (localInputs.type === 18 && localInputs.other === '') {
|
||||||
localInputs.other = 'v2.1';
|
localInputs.other = 'v2.1';
|
||||||
@ -348,7 +348,7 @@ const EditChannel = (props) => {
|
|||||||
<Input
|
<Input
|
||||||
label='默认 API 版本'
|
label='默认 API 版本'
|
||||||
name='azure_other'
|
name='azure_other'
|
||||||
placeholder={'请输入默认 API 版本,例如:2023-06-01-preview,该配置可以被实际的请求查询参数所覆盖'}
|
placeholder={'请输入默认 API 版本,例如:2024-03-01-preview,该配置可以被实际的请求查询参数所覆盖'}
|
||||||
onChange={value => {
|
onChange={value => {
|
||||||
handleInputChange('other', value)
|
handleInputChange('other', value)
|
||||||
}}
|
}}
|
||||||
|
@ -49,7 +49,7 @@ const typeConfig = {
|
|||||||
base_url: "请填写AZURE_OPENAI_ENDPOINT",
|
base_url: "请填写AZURE_OPENAI_ENDPOINT",
|
||||||
|
|
||||||
// 注意:通过判断 `other` 是否有值来判断是否需要显示 `other` 输入框, 默认是没有值的
|
// 注意:通过判断 `other` 是否有值来判断是否需要显示 `other` 输入框, 默认是没有值的
|
||||||
other: "请输入默认API版本,例如:2023-06-01-preview",
|
other: "请输入默认API版本,例如:2024-03-01-preview",
|
||||||
},
|
},
|
||||||
modelGroup: "openai", // 模型组名称,这个值是给 填入渠道支持模型 按钮使用的。 填入渠道支持模型 按钮会根据这个值来获取模型组,如果填写默认是 openai
|
modelGroup: "openai", // 模型组名称,这个值是给 填入渠道支持模型 按钮使用的。 填入渠道支持模型 按钮会根据这个值来获取模型组,如果填写默认是 openai
|
||||||
},
|
},
|
||||||
|
@ -41,7 +41,7 @@ const typeConfig = {
|
|||||||
},
|
},
|
||||||
prompt: {
|
prompt: {
|
||||||
base_url: "请填写AZURE_OPENAI_ENDPOINT",
|
base_url: "请填写AZURE_OPENAI_ENDPOINT",
|
||||||
other: "请输入默认API版本,例如:2023-06-01-preview",
|
other: "请输入默认API版本,例如:2024-03-01-preview",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
11: {
|
11: {
|
||||||
|
@ -160,7 +160,7 @@ const EditChannel = () => {
|
|||||||
localInputs.base_url = localInputs.base_url.slice(0, localInputs.base_url.length - 1);
|
localInputs.base_url = localInputs.base_url.slice(0, localInputs.base_url.length - 1);
|
||||||
}
|
}
|
||||||
if (localInputs.type === 3 && localInputs.other === '') {
|
if (localInputs.type === 3 && localInputs.other === '') {
|
||||||
localInputs.other = '2023-06-01-preview';
|
localInputs.other = '2024-03-01-preview';
|
||||||
}
|
}
|
||||||
if (localInputs.type === 18 && localInputs.other === '') {
|
if (localInputs.type === 18 && localInputs.other === '') {
|
||||||
localInputs.other = 'v2.1';
|
localInputs.other = 'v2.1';
|
||||||
@ -242,7 +242,7 @@ const EditChannel = () => {
|
|||||||
<Form.Input
|
<Form.Input
|
||||||
label='默认 API 版本'
|
label='默认 API 版本'
|
||||||
name='other'
|
name='other'
|
||||||
placeholder={'请输入默认 API 版本,例如:2023-06-01-preview,该配置可以被实际的请求查询参数所覆盖'}
|
placeholder={'请输入默认 API 版本,例如:2024-03-01-preview,该配置可以被实际的请求查询参数所覆盖'}
|
||||||
onChange={handleInputChange}
|
onChange={handleInputChange}
|
||||||
value={inputs.other}
|
value={inputs.other}
|
||||||
autoComplete='new-password'
|
autoComplete='new-password'
|
||||||
|
Loading…
Reference in New Issue
Block a user