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

Function detectModelCapability

internal/thinking/convert.go:162–183  ·  view source on GitHub ↗

detectModelCapability determines the thinking format capability of a model. This is an internal function used by validation and conversion helpers. It analyzes the model's ThinkingSupport configuration to classify the model: - CapabilityNone: modelInfo.Thinking is nil (model doesn't support thinkin

(modelInfo *registry.ModelInfo)

Source from the content-addressed store, hash-verified

160//
161// Note: Returns a special sentinel value when modelInfo itself is nil (unknown model).
162func detectModelCapability(modelInfo *registry.ModelInfo) ModelCapability {
163 if modelInfo == nil {
164 return CapabilityUnknown // sentinel for "passthrough" behavior
165 }
166 if modelInfo.Thinking == nil {
167 return CapabilityNone
168 }
169 support := modelInfo.Thinking
170 hasBudget := support.Min > 0 || support.Max > 0
171 hasLevels := len(support.Levels) > 0
172
173 switch {
174 case hasBudget && hasLevels:
175 return CapabilityHybrid
176 case hasBudget:
177 return CapabilityBudgetOnly
178 case hasLevels:
179 return CapabilityLevelOnly
180 default:
181 return CapabilityNone
182 }
183}

Callers 1

ValidateConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected