Răsfoiți Sursa

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

CaIon 4 luni în urmă
părinte
comite
5654d08086
1 a modificat fișierele cu 7 adăugiri și 0 ștergeri
  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