blob: 295f2c67770f0de6154f669267ab0f7ec9b71a39 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
pub const APIStyle = enum {
anthropic,
};
pub const Config = struct {
api_style: APIStyle,
api_key: []const u8,
base_url: []const u8,
model: []const u8,
};
const t = @import("std").testing;
test "Config - construct with all fields" {
const cfg = Config{
.api_style = .anthropic,
.api_key = "sk-ant-test",
.base_url = "https://api.anthropic.com",
.model = "claude-sonnet-4-20250514",
};
try t.expectEqual(APIStyle.anthropic, cfg.api_style);
try t.expectEqualStrings("sk-ant-test", cfg.api_key);
try t.expectEqualStrings("https://api.anthropic.com", cfg.base_url);
try t.expectEqualStrings("claude-sonnet-4-20250514", cfg.model);
}
|