MCPcopy Create free account
hub / github.com/53AI/53AIHub / GetAddModelString

Method GetAddModelString

api/model/channel.go:356–373  ·  view source on GitHub ↗
(model string)

Source from the content-addressed store, hash-verified

354}
355
356func (channel *Channel) GetAddModelString(model string) string {
357 existingModels := make(map[string]bool)
358 for _, m := range strings.Split(channel.Models, ",") {
359 existingModels[m] = true
360 }
361
362 // 如果新模型不存在,则添加
363 if !existingModels[model] {
364 existingModels[model] = true
365 }
366
367 // 将map转换回切片
368 var models []string
369 for m := range existingModels {
370 models = append(models, m)
371 }
372 return strings.Join(models, ",")
373}
374
375// UpdateChannelConfigOnly 更新渠道配置,但保留原有配置数据
376func UpdateChannelConfigOnly(channelID int64, newConfig map[string]interface{}) error {

Callers 1

executeWorkflowFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected