MCPcopy Index your code
hub / github.com/docker/docker-agent / CycleAgentThinkingLevel

Method CycleAgentThinkingLevel

pkg/runtime/model_switcher.go:196–202  ·  view source on GitHub ↗

CycleAgentThinkingLevel implements [Runtime.CycleAgentThinkingLevel] for LocalRuntime. It reads the agent's current effective model, advances the thinking-effort level by one step through the levels that specific model supports (see [modelinfo.SupportedThinkingLevels]), re-creates the provider(s) wi

(ctx context.Context, agentName string)

Source from the content-addressed store, hash-verified

194// supports (see [modelinfo.SupportedThinkingLevels]), re-creates the
195// provider(s) with the new level, and installs them as a runtime override.
196func (r *LocalRuntime) CycleAgentThinkingLevel(ctx context.Context, agentName string) (effort.Level, error) {
197 return r.applyAgentThinkingLevel(ctx, agentName, func(supported []effort.Level, current effort.Level) (effort.Level, error) {
198 // Clamp first so a configured level the model does not support re-enters
199 // the cycle at the nearest supported tier instead of resetting it.
200 return effort.NextSupportedLevel(supported, effort.Clamp(supported, current)), nil
201 })
202}
203
204// SetAgentThinkingLevel implements [Runtime.SetAgentThinkingLevel] for
205// LocalRuntime. The requested level must be one the agent's current model

Calls 3

NextSupportedLevelFunction · 0.92
ClampFunction · 0.92