MCPcopy Create free account
hub / github.com/InferCore/InferCore / supportsTask

Function supportsTask

internal/router/rule_router.go:152–165  ·  view source on GitHub ↗
(backend config.BackendConfig, taskType string)

Source from the content-addressed store, hash-verified

150}
151
152func supportsTask(backend config.BackendConfig, taskType string) bool {
153 if taskType == "" {
154 return true
155 }
156
157 switch taskType {
158 case "simple":
159 return hasCapability(backend.Capabilities, "chat") || hasCapability(backend.Capabilities, "summarization")
160 case "complex":
161 return hasCapability(backend.Capabilities, "reasoning")
162 default:
163 return hasCapability(backend.Capabilities, taskType)
164 }
165}
166
167func hasCapability(capabilities []string, expected string) bool {
168 for _, c := range capabilities {

Callers 1

optimizeByCostMethod · 0.85

Calls 1

hasCapabilityFunction · 0.85

Tested by

no test coverage detected