(in []*registry.ModelInfo)
| 214 | } |
| 215 | |
| 216 | func cloneRegistryModels(in []*registry.ModelInfo) []*registry.ModelInfo { |
| 217 | if len(in) == 0 { |
| 218 | return nil |
| 219 | } |
| 220 | out := make([]*registry.ModelInfo, 0, len(in)) |
| 221 | for _, model := range in { |
| 222 | if model == nil { |
| 223 | continue |
| 224 | } |
| 225 | copyModel := *model |
| 226 | copyModel.SupportedGenerationMethods = cloneStringSlice(model.SupportedGenerationMethods) |
| 227 | copyModel.SupportedParameters = cloneStringSlice(model.SupportedParameters) |
| 228 | copyModel.SupportedInputModalities = cloneStringSlice(model.SupportedInputModalities) |
| 229 | copyModel.SupportedOutputModalities = cloneStringSlice(model.SupportedOutputModalities) |
| 230 | if model.Thinking != nil { |
| 231 | thinking := *model.Thinking |
| 232 | thinking.Levels = cloneStringSlice(model.Thinking.Levels) |
| 233 | copyModel.Thinking = &thinking |
| 234 | } |
| 235 | out = append(out, ©Model) |
| 236 | } |
| 237 | return out |
| 238 | } |
| 239 | |
| 240 | func (h *Host) RegisterModels(ctx context.Context, modelRegistry modelRegistry) { |
| 241 | if h == nil || modelRegistry == nil { |
no test coverage detected