MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / cloneRegistryModels

Function cloneRegistryModels

internal/pluginhost/adapters.go:216–238  ·  view source on GitHub ↗
(in []*registry.ModelInfo)

Source from the content-addressed store, hash-verified

214}
215
216func 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, &copyModel)
236 }
237 return out
238}
239
240func (h *Host) RegisterModels(ctx context.Context, modelRegistry modelRegistry) {
241 if h == nil || modelRegistry == nil {

Callers 6

RegisterModelsMethod · 0.85
commitExecutorStateMethod · 0.85
modelRegistrationMethod · 0.85
appendModelsForProviderFunction · 0.85
ModelsForProviderMethod · 0.85

Calls 1

cloneStringSliceFunction · 0.70

Tested by

no test coverage detected