diff options
| author | t <t@tjp.lol> | 2026-07-04 09:50:12 -0600 |
|---|---|---|
| committer | t <t@tjp.lol> | 2026-07-05 16:23:49 -0600 |
| commit | f759f149377942c4e04802c45162cda1c9bfb2b3 (patch) | |
| tree | 397dd2fc35839d8fcbf6a5c237bee363c6ed3c07 /src/tui_selectors.zig | |
| parent | 1ed07e2e4473b91c669c062bbfef6bb499f7d2b7 (diff) | |
big cli/tui gaps project
Diffstat (limited to 'src/tui_selectors.zig')
| -rw-r--r-- | src/tui_selectors.zig | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/tui_selectors.zig b/src/tui_selectors.zig index e76f82d..4424695 100644 --- a/src/tui_selectors.zig +++ b/src/tui_selectors.zig @@ -94,6 +94,16 @@ pub const ReasoningOption = struct { }; } + /// Look up an option by label (case-insensitive) among the levels the + /// given style supports. Null when the style has no such level (e.g. + /// "xhigh" on an OpenAI provider). + pub fn byLabel(style: APIStyle, label: []const u8) ?ReasoningOption { + for (forStyle(style)) |opt| { + if (std.ascii.eqlIgnoreCase(opt.label, label)) return opt; + } + return null; + } + /// Write this option into a provider config (must be the same style). pub fn apply(self: ReasoningOption, cfg: *ProviderConfig) void { switch (self.value) { |
