소스 검색

feat: set API version for Azure and Vertex AI channel types

CaIon 6 달 전
부모
커밋
5654d08086
1개의 변경된 파일7개의 추가작업 그리고 0개의 파일을 삭제
  1. 7 0
      relay/common/relay_info.go

+ 7 - 0
relay/common/relay_info.go

@@ -138,6 +138,13 @@ func (info *RelayInfo) InitChannelMeta(c *gin.Context) {
 		SupportStreamOptions: false,
 	}
 
+	if channelType == constant.ChannelTypeAzure {
+		channelMeta.ApiVersion = GetAPIVersion(c)
+	}
+	if channelType == constant.ChannelTypeVertexAi {
+		channelMeta.ApiVersion = c.GetString("region")
+	}
+
 	channelSetting, ok := common.GetContextKeyType[dto.ChannelSettings](c, constant.ContextKeyChannelSetting)
 	if ok {
 		channelMeta.ChannelSetting = channelSetting