diff options
Diffstat (limited to 'libpanto/src/provider.zig')
| -rw-r--r-- | libpanto/src/provider.zig | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libpanto/src/provider.zig b/libpanto/src/provider.zig index 0fe0ed4..8ea74f3 100644 --- a/libpanto/src/provider.zig +++ b/libpanto/src/provider.zig @@ -243,13 +243,14 @@ pub const ProviderStream = struct { /// `*const Config` between turns changes provider, model, base_url, and the /// visible tool set with no transport teardown. /// -/// The tool registry is taken from `cfg.registry`; the serializers receive -/// it directly. On success the caller owns the returned `ProviderStream` and -/// must `deinit` it. +/// The tool registry is supplied by the caller (the `Agent` owns it now, +/// not `cfg`); the serializers receive it directly. On success the caller +/// owns the returned `ProviderStream` and must `deinit` it. pub fn openStream( allocator: std.mem.Allocator, io: std.Io, cfg: *const config_mod.Config, + registry: *const ToolRegistry, conv: *conversation.Conversation, diag: ?*ProviderDiagnostic, ) anyerror!ProviderStream { @@ -267,7 +268,7 @@ pub fn openStream( .http_client = client, .diag = diag, }; - const rr = try req.open(conv, cfg.registry); + const rr = try req.open(conv, registry); return rr.providerStream(); }, .anthropic_messages => |*c| { @@ -278,7 +279,7 @@ pub fn openStream( .http_client = client, .diag = diag, }; - const rr = try req.open(conv, cfg.registry); + const rr = try req.open(conv, registry); return rr.providerStream(); }, } @@ -291,6 +292,7 @@ pub const OpenStreamFn = *const fn ( allocator: std.mem.Allocator, io: std.Io, cfg: *const config_mod.Config, + registry: *const ToolRegistry, conv: *conversation.Conversation, diag: ?*ProviderDiagnostic, ) anyerror!ProviderStream; |
