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

Function cloneModelInfo

internal/registry/model_registry.go:534–559  ·  view source on GitHub ↗
(model *ModelInfo)

Source from the content-addressed store, hash-verified

532}
533
534func cloneModelInfo(model *ModelInfo) *ModelInfo {
535 if model == nil {
536 return nil
537 }
538 copyModel := *model
539 if len(model.SupportedGenerationMethods) > 0 {
540 copyModel.SupportedGenerationMethods = append([]string(nil), model.SupportedGenerationMethods...)
541 }
542 if len(model.SupportedParameters) > 0 {
543 copyModel.SupportedParameters = append([]string(nil), model.SupportedParameters...)
544 }
545 if len(model.SupportedInputModalities) > 0 {
546 copyModel.SupportedInputModalities = append([]string(nil), model.SupportedInputModalities...)
547 }
548 if len(model.SupportedOutputModalities) > 0 {
549 copyModel.SupportedOutputModalities = append([]string(nil), model.SupportedOutputModalities...)
550 }
551 if model.Thinking != nil {
552 copyThinking := *model.Thinking
553 if len(model.Thinking.Levels) > 0 {
554 copyThinking.Levels = append([]string(nil), model.Thinking.Levels...)
555 }
556 copyModel.Thinking = &copyThinking
557 }
558 return &copyModel
559}
560
561func cloneModelInfosUnique(models []*ModelInfo) []*ModelInfo {
562 if len(models) == 0 {

Callers 10

upsertModelInfosFunction · 0.85
cloneModelInfosFunction · 0.85
LookupStaticModelInfoFunction · 0.85
LookupModelInfoFunction · 0.85
RegisterClientMethod · 0.85
addModelRegistrationMethod · 0.85
cloneModelInfosUniqueFunction · 0.85
GetModelInfoMethod · 0.85
GetModelsForClientMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected