feat: add AzureNoRemoveDotTime constant and update channel handling #1044

- Introduced a new constant `AzureNoRemoveDotTime` in `constant/azure.go` to manage model name formatting for channels created after May 10, 2025.
- Updated `distributor.go` to set `channel_create_time` in the context.
- Modified `adaptor.go` to conditionally remove dots from model names based on the channel creation time.
- Enhanced `relay_info.go` to include `ChannelCreateTime` in the `RelayInfo` struct.
- Updated English localization files to reflect changes in model name handling for new channels.
This commit is contained in:
CaIon
2025-05-08 22:39:55 +08:00
parent d40429ad93
commit 90d85a6f0a
6 changed files with 39 additions and 28 deletions

View File

@@ -493,6 +493,7 @@
"默认": "default",
"图片演示": "Image demo",
"注意系统请求的时模型名称中的点会被剔除例如gpt-4.1会请求为gpt-41所以在Azure部署的时候部署模型名称需要手动改为gpt-41": "Note that the dot in the model name requested by the system will be removed, for example: gpt-4.1 will be requested as gpt-41, so when deploying on Azure, the deployment model name needs to be manually changed to gpt-41",
"2025年5月10日后添加的渠道不需要再在部署的时候移除模型名称中的\".\"": "After May 10, 2025, channels added do not need to remove the dot in the model name during deployment",
"模型映射必须是合法的 JSON 格式!": "Model mapping must be in valid JSON format!",
"取消无限额度": "Cancel unlimited quota",
"取消": "Cancel",

View File

@@ -477,24 +477,24 @@ const EditChannel = (props) => {
type={'warning'}
description={
<>
{t('注意系统请求的时模型名称中的点会被剔除例如gpt-4.1会请求为gpt-41所以在Azure部署的时候,部署模型名称需要手动改为gpt-41')}
<br />
<Typography.Text
style={{
color: 'rgba(var(--semi-blue-5), 1)',
userSelect: 'none',
cursor: 'pointer',
}}
onClick={() => {
setModalImageUrl(
'/azure_model_name.png',
);
setIsModalOpenurl(true)
{t('2025年5月10日后添加的渠道不需要再在部署的时候移除模型名称中的"."')}
{/*<br />*/}
{/*<Typography.Text*/}
{/* style={{*/}
{/* color: 'rgba(var(--semi-blue-5), 1)',*/}
{/* userSelect: 'none',*/}
{/* cursor: 'pointer',*/}
{/* }}*/}
{/* onClick={() => {*/}
{/* setModalImageUrl(*/}
{/* '/azure_model_name.png',*/}
{/* );*/}
{/* setIsModalOpenurl(true)*/}
}}
>
{t('查看示例')}
</Typography.Text>
{/* }}*/}
{/*>*/}
{/* {t('查看示例')}*/}
{/*</Typography.Text>*/}
</>
}
></Banner>