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

Function LookupModelInfo

internal/registry/model_registry.go:173–188  ·  view source on GitHub ↗

LookupModelInfo searches dynamic registry (provider-specific > global) then static definitions.

(modelID string, provider ...string)

Source from the content-addressed store, hash-verified

171
172// LookupModelInfo searches dynamic registry (provider-specific > global) then static definitions.
173func LookupModelInfo(modelID string, provider ...string) *ModelInfo {
174 modelID = strings.TrimSpace(modelID)
175 if modelID == "" {
176 return nil
177 }
178
179 p := ""
180 if len(provider) > 0 {
181 p = strings.ToLower(strings.TrimSpace(provider[0]))
182 }
183
184 if info := GetGlobalRegistry().GetModelInfo(modelID, p); info != nil {
185 return cloneModelInfo(info)
186 }
187 return cloneModelInfo(LookupStaticModelInfo(modelID))
188}
189
190// SetHook sets an optional hook for observing model registration changes.
191func (r *ModelRegistry) SetHook(hook ModelRegistryHook) {

Calls 4

GetGlobalRegistryFunction · 0.85
cloneModelInfoFunction · 0.85
LookupStaticModelInfoFunction · 0.85
GetModelInfoMethod · 0.80