From f759f149377942c4e04802c45162cda1c9bfb2b3 Mon Sep 17 00:00:00 2001 From: t Date: Sat, 4 Jul 2026 09:50:12 -0600 Subject: big cli/tui gaps project --- src/tui_selectors.zig | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/tui_selectors.zig') 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) { -- cgit v1.3