MCPcopy
hub / github.com/QuantumNous/new-api / channelOwnerName

Function channelOwnerName

controller/model.go:113–129  ·  view source on GitHub ↗
(channelType int)

Source from the content-addressed store, hash-verified

111}
112
113func channelOwnerName(channelType int) string {
114 apiType, success := common.ChannelType2APIType(channelType)
115 if !success {
116 return strings.ToLower(constant.GetChannelTypeName(channelType))
117 }
118 adaptor := relay.GetAdaptor(apiType)
119 if adaptor == nil {
120 return strings.ToLower(constant.GetChannelTypeName(channelType))
121 }
122 adaptor.Init(&relaycommon.RelayInfo{ChannelMeta: &relaycommon.ChannelMeta{
123 ChannelType: channelType,
124 }})
125 if name := strings.TrimSpace(adaptor.GetChannelName()); name != "" {
126 return name
127 }
128 return strings.ToLower(constant.GetChannelTypeName(channelType))
129}
130
131func getPreferredModelOwners(modelNames []string, groups []string) map[string]string {
132 channelTypes, err := model.GetPreferredModelOwnerChannelTypes(modelNames, groups)

Calls 4

GetChannelTypeNameFunction · 0.92
GetAdaptorFunction · 0.92
InitMethod · 0.65
GetChannelNameMethod · 0.65