MCPcopy Create free account
hub / github.com/QuantumNous/new-api / ResolveTaskModelAlias

Function ResolveTaskModelAlias

model/task_model_alias.go:38–48  ·  view source on GitHub ↗

ResolveTaskModelAlias returns the mapping-derived alias target for name (exact or ASCII-folded). g is the caller's routing generation: a Number mismatch or TTL expiry rebuilds the view against that generation.

(g *jsplugin.RoutingGeneration, name string)

Source from the content-addressed store, hash-verified

36// (exact or ASCII-folded). g is the caller's routing generation: a Number
37// mismatch or TTL expiry rebuilds the view against that generation.
38func ResolveTaskModelAlias(g *jsplugin.RoutingGeneration, name string) (TaskAliasTarget, bool) {
39 if g == nil || name == "" {
40 return TaskAliasTarget{}, false
41 }
42 view := loadFreshTaskAliasView(g)
43 if view == nil {
44 return TaskAliasTarget{}, false
45 }
46 target, ok := view.byFold[jsplugin.ASCIIFold(name)]
47 return target, ok
48}
49
50func loadFreshTaskAliasView(g *jsplugin.RoutingGeneration) *taskAliasView {
51 view := taskAliasViewPtr.Load()

Callers 6

PinTaskPluginEndpointFunction · 0.92
PrepareTaskPluginSubmitFunction · 0.92
UpdateOptionFunction · 0.92
updatePricingFunction · 0.85
GetModelPricingSnapshotFunction · 0.85
ValidateModelPricingFunction · 0.85

Calls 2

ASCIIFoldFunction · 0.92
loadFreshTaskAliasViewFunction · 0.85

Tested by

no test coverage detected