summaryrefslogtreecommitdiff
path: root/libawl/src/provider.zig
diff options
context:
space:
mode:
authorT <t@tjp.lol>2026-05-25 12:19:50 -0700
committerT <t@tjp.lol>2026-05-25 12:39:24 -0700
commite8272efd9f71ad27a0e62b6b3fa3d13e99a6736f (patch)
tree16932c3f947aac908e15b77a71f9db3184e18a5c /libawl/src/provider.zig
parent52b2ca78aed7950af27d4865aee65da781514a99 (diff)
work
Diffstat (limited to 'libawl/src/provider.zig')
-rw-r--r--libawl/src/provider.zig66
1 files changed, 0 insertions, 66 deletions
diff --git a/libawl/src/provider.zig b/libawl/src/provider.zig
deleted file mode 100644
index 8d6eea5..0000000
--- a/libawl/src/provider.zig
+++ /dev/null
@@ -1,66 +0,0 @@
-const std = @import("std");
-const conversation = @import("conversation.zig");
-
-pub const ContentBlockType = enum {
- Text,
- Thinking,
- ToolUse,
- ToolResult,
-};
-
-pub const BlockMeta = struct {
- /// Only populated for ToolUse blocks. Null for Text/Thinking.
- tool_id: ?[]const u8 = null,
- tool_name: ?[]const u8 = null,
-};
-
-pub const ReceiverVTable = struct {
- onMessageStart: *const fn (*anyopaque, conversation.MessageRole) void,
- onBlockStart: *const fn (*anyopaque, ContentBlockType, usize, ?BlockMeta) void,
- onContentDelta: *const fn (*anyopaque, usize, []const u8) void,
- onBlockComplete: *const fn (*anyopaque, usize, conversation.ContentBlock) void,
- onMessageComplete: *const fn (*anyopaque, conversation.Message) void,
-};
-
-pub const Receiver = struct {
- ptr: *anyopaque,
- vtable: *const ReceiverVTable,
-
- pub fn onMessageStart(self: Receiver, role: conversation.MessageRole) void {
- self.vtable.onMessageStart(self.ptr, role);
- }
-
- pub fn onBlockStart(self: Receiver, block_type: ContentBlockType, index: usize, meta: ?BlockMeta) void {
- self.vtable.onBlockStart(self.ptr, block_type, index, meta);
- }
-
- pub fn onContentDelta(self: Receiver, block_index: usize, delta: []const u8) void {
- self.vtable.onContentDelta(self.ptr, block_index, delta);
- }
-
- pub fn onBlockComplete(self: Receiver, block_index: usize, block: conversation.ContentBlock) void {
- self.vtable.onBlockComplete(self.ptr, block_index, block);
- }
-
- pub fn onMessageComplete(self: Receiver, message: conversation.Message) void {
- self.vtable.onMessageComplete(self.ptr, message);
- }
-};
-
-pub const ProviderVTable = struct {
- streamStep: *const fn (*anyopaque, *conversation.Conversation, *Receiver) anyerror!void,
- deinit: *const fn (*anyopaque) void,
-};
-
-pub const Provider = struct {
- ptr: *anyopaque,
- vtable: *const ProviderVTable,
-
- pub fn streamStep(self: Provider, conv: *conversation.Conversation, receiver: *Receiver) anyerror!void {
- return self.vtable.streamStep(self.ptr, conv, receiver);
- }
-
- pub fn deinit(self: Provider) void {
- self.vtable.deinit(self.ptr);
- }
-};