RemainingUses reports how many advisor calls are still available for the current runtime.
()
| 110 | // RemainingUses reports how many advisor calls are still available for the |
| 111 | // current runtime. |
| 112 | func (rt *Runtime) RemainingUses() int { |
| 113 | if rt == nil || rt.cfg.MaxUsesPerRun <= 0 { |
| 114 | return 0 |
| 115 | } |
| 116 | |
| 117 | remaining := int64(rt.cfg.MaxUsesPerRun) - rt.used.Load() |
| 118 | if remaining < 0 { |
| 119 | return 0 |
| 120 | } |
| 121 | return int(remaining) |
| 122 | } |
| 123 | |
| 124 | // MaxOutputTokens reports the resolved output-token cap applied to each |
| 125 | // advisor call. NewRuntime validates that this value is positive and that |