MCPcopy Create free account
hub / github.com/astercloud/aster / DisableModel

Method DisableModel

pkg/agent/model_fallback.go:263–276  ·  view source on GitHub ↗

DisableModel 禁用指定模型

(provider, model string)

Source from the content-addressed store, hash-verified

261
262// DisableModel 禁用指定模型
263func (m *ModelFallbackManager) DisableModel(provider, model string) error {
264 modelKey := fmt.Sprintf("%s/%s", provider, model)
265
266 for _, fb := range m.fallbacks {
267 fbKey := fmt.Sprintf("%s/%s", fb.Config.Provider, fb.Config.Model)
268 if fbKey == modelKey {
269 fb.Enabled = false
270 fallbackLog.Info(context.Background(), "disabled model", map[string]any{"model": modelKey})
271 return nil
272 }
273 }
274
275 return fmt.Errorf("model not found: %s", modelKey)
276}
277
278// ListModels 列出所有模型及其状态
279func (m *ModelFallbackManager) ListModels() []map[string]any {

Callers 2

mainFunction · 0.95

Calls 1

InfoMethod · 0.65