summaryrefslogtreecommitdiff
path: root/src/tui_selectors.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/tui_selectors.zig')
-rw-r--r--src/tui_selectors.zig10
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) {