blob: ff02d4df6c6528d7bb04b116ed2762abcb663110 (
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
const std = @import("std");
pub const conversation = @import("conversation.zig");
pub const provider = @import("provider.zig");
pub const agent = @import("agent.zig");
pub const config = @import("config.zig");
pub const sse = @import("sse.zig");
pub const tool = @import("tool.zig");
pub const tool_source = @import("tool_source.zig");
pub const tool_registry = @import("tool_registry.zig");
// Re-exports for ergonomic embedder use.
pub const Tool = tool.Tool;
pub const ToolSource = tool_source.ToolSource;
pub const ToolDecl = tool_source.ToolDecl;
pub const ToolCall = tool_source.Call;
pub const ToolCallResult = tool_source.CallResult;
pub const ToolRegistry = tool_registry.ToolRegistry;
// Internal modules. Not part of the public API — callers construct providers
// via `provider.Provider.init(allocator, io, config)`, which picks the right
// concrete implementation based on the config's API style. These are exposed
// here only so `refAllDecls` picks up their tests.
const openai_chat_json = @import("openai_chat_json.zig");
const provider_openai_chat = @import("provider_openai_chat.zig");
const anthropic_messages_json = @import("anthropic_messages_json.zig");
const provider_anthropic_messages = @import("provider_anthropic_messages.zig");
test {
// Test contract: deliberate error-path tests should not produce visible
// log output. Library code logs at `.err` for genuine production failures
// and `.warn` for expected-failure paths exercised by tests; the test
// runner's logger gates on `std.testing.log_level`, which defaults to
// `.warn`. Raising it to `.err` silences expected warnings without
// changing production behavior. Anything that *should* be visible in a
// passing test must use `std.debug.print` or assert via the testing API.
std.testing.log_level = .err;
std.testing.refAllDecls(@This());
std.testing.refAllDecls(openai_chat_json);
std.testing.refAllDecls(provider_openai_chat);
std.testing.refAllDecls(anthropic_messages_json);
std.testing.refAllDecls(provider_anthropic_messages);
}
|