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/models_toml.zig | |
| parent | 1ed07e2e4473b91c669c062bbfef6bb499f7d2b7 (diff) | |
big cli/tui gaps project
Diffstat (limited to 'src/models_toml.zig')
| -rw-r--r-- | src/models_toml.zig | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/models_toml.zig b/src/models_toml.zig index 9b1b4f0..cd2de1a 100644 --- a/src/models_toml.zig +++ b/src/models_toml.zig @@ -99,6 +99,10 @@ pub const ModelDef = struct { /// TOML omitted `model`. model: []const u8, reasoning: ReasoningEffort, + /// True when the TOML explicitly set a reasoning knob (`reasoning`, + /// `thinking`, or `effort`) for this alias. An explicit per-alias knob + /// wins over the config.toml `[defaults] reasoning` session default. + reasoning_explicit: bool = false, /// Approximate total input context window, for picker/UI metadata. context_window: ?u32 = null, /// Per-request output token cap; null = use the provider/library default. @@ -410,6 +414,7 @@ fn ingestModel( .alias = alias_copy, .model = model_copy, .reasoning = reasoning, + .reasoning_explicit = v.get("reasoning") != null or v.get("thinking") != null or has_effort, .context_window = context_window, .max_tokens = max_tokens, .api_version = api_version_copy, @@ -476,12 +481,14 @@ test "parseInto: model defs carry wire name and knobs, keyed by provider.alias" const sonnet = models.defs.get("anthropic", "sonnet").?; try testing.expectEqualStrings("claude-sonnet-4-20250514", sonnet.model); try testing.expectEqual(ReasoningEffort.high, sonnet.reasoning); + try testing.expect(sonnet.reasoning_explicit); try testing.expectEqual(@as(?u32, 200000), sonnet.context_window); try testing.expectEqual(@as(?u32, 8192), sonnet.max_tokens); const gpt = models.defs.get("openai", "gpt").?; try testing.expectEqualStrings("gpt-4o", gpt.model); try testing.expectEqual(ReasoningEffort.default, gpt.reasoning); + try testing.expect(!gpt.reasoning_explicit); try testing.expectEqual(@as(?u32, null), gpt.max_tokens); // Pricing keyed on the wire model id. |
