blob: 7ebc05875df17414c5e248597f2c45d8939746e8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
const std = @import("std");
const provider = @import("provider.zig");
const conversation = @import("conversation.zig");
pub const Agent = struct {
provider: provider.Provider,
allocator: std.mem.Allocator,
pub fn init(allocator: std.mem.Allocator, prov: provider.Provider) Agent {
return .{
.provider = prov,
.allocator = allocator,
};
}
pub fn runStep(self: Agent, conv: *conversation.Conversation, receiver: *provider.Receiver) !void {
try self.provider.streamStep(conv, receiver);
}
pub fn deinit(self: Agent) void {
self.provider.deinit();
}
};
|