MCPcopy
hub / github.com/docker/docker-agent / Parse

Function Parse

pkg/effort/effort.go:47–53  ·  view source on GitHub ↗

Parse normalises s (case-insensitive, trimmed) and returns the matching Level. It returns ("", false) for unknown strings, adaptive values, and empty input. Use [IsValid] for full validation including adaptive forms.

(s string)

Source from the content-addressed store, hash-verified

45// Level. It returns ("", false) for unknown strings, adaptive values, and
46// empty input. Use [IsValid] for full validation including adaptive forms.
47func Parse(s string) (Level, bool) {
48 l := normalize(s)
49 if allLevels[l] {
50 return l, true
51 }
52 return "", false
53}
54
55// IsValid reports whether s is a recognised thinking_budget effort value.
56// It accepts every [Level] constant, plain "adaptive", and the

Callers 14

openEffortPickerMethod · 0.92
thinkingBadgeFunction · 0.92
ThinkingMarkerFunction · 0.92
gemini3ThinkingLevelFunction · 0.92
effortBudgetTokensFunction · 0.92
EffortLevelMethod · 0.92
EffortLevelMethod · 0.92
EffortLevelMethod · 0.92
EffortLevelMethod · 0.92
EffortLevelMethod · 0.92

Calls 1

normalizeFunction · 0.70

Tested by 1

TestParseFunction · 0.68