diff --git a/build.zig.zon b/build.zig.zon index d2d5db5c..d81b55bc 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -39,8 +39,8 @@ .hash = "N-V-__8AABGOuAC_dhAN07kfoP4dycCFi8Bka4O-tuhriNH8", }, .zenai = .{ - .url = "git+https://github.com/lightpanda-io/zenai.git#979aa12f51e4a905e37b73d5304a3e743f9dc1e2", - .hash = "zenai-0.0.0-iOY_VFmvAwDV5WFQ_AcUUGzkyMRsCJy17GPNfI7pUNFQ", + .url = "git+https://github.com/lightpanda-io/zenai.git#ed860aab9f8cbd0b80d9cd72f32ed06cb98a628a", + .hash = "zenai-0.0.0-iOY_VMCwAwBAtfcdSjNg9LpWIrJsoxGgAop2FGJPyC0D", }, .isocline = .{ .url = "git+https://github.com/arrufat/isocline.git#48d94027aec0408dc58af9ca2dfedf4720870e8c", diff --git a/src/agent/Agent.zig b/src/agent/Agent.zig index 68093e89..037d124d 100644 --- a/src/agent/Agent.zig +++ b/src/agent/Agent.zig @@ -1215,7 +1215,7 @@ const Llm = struct { const key = zenai.provider.envApiKey(p) orelse { std.debug.print( "Missing API key for --provider {s}: set {s} — or pass --no-llm for the basic REPL.\n", - .{ @tagName(p), envVarName(p) }, + .{ @tagName(p), zenai.provider.envVarName(p) }, ); return error.MissingApiKey; }; @@ -1240,7 +1240,7 @@ const Llm = struct { break :blk null; }, 1 => blk: { - std.debug.print("Detected {s} — using --provider {s}.\n", .{ envVarName(found[0].provider), @tagName(found[0].provider) }); + std.debug.print("Detected {s} — using --provider {s}.\n", .{ zenai.provider.envVarName(found[0].provider), @tagName(found[0].provider) }); break :blk found[0]; }, else => try pickProvider(found[0..n]), @@ -1277,15 +1277,6 @@ pub fn listModels(allocator: std.mem.Allocator, opts: Config.Agent) !void { try w.flush(); } -fn envVarName(p: Config.AiProvider) []const u8 { - return switch (p) { - .anthropic => "ANTHROPIC_API_KEY", - .openai => "OPENAI_API_KEY", - .gemini => "GOOGLE_API_KEY/GEMINI_API_KEY", - .ollama => "", - }; -} - fn defaultModel(p: Config.AiProvider) []const u8 { return switch (p) { .anthropic => "claude-sonnet-4-6",