Interface IPromptTemplateRegistry
Resolves a named prompt template into the actual system / user text the
engine should send to the provider. Versioning is required so that a
recorded eval run can be replayed against the exact template that produced it.
The optional exchange parameter on every method carries the route
pipeline's current exchange; REDB-backed implementations resolve a
per-exchange through
IRouteContext.GetRedbService(name, exchange). In-memory
implementations ignore it.
Without an exchange a redb-backed implementation opens a redb scope of its own for the call. That scope joins an
ambient (a , a
route's .Transacted()) as every redb connection does, but not a transaction begun on the context's shared
IRedbService (ExecuteAtomicAsync, BeginTransaction), which it does not see: pass the exchange,
or use a TransactionScope, when the call must commit or roll back with that work. In-memory implementations
take part in no transaction.
public interface IPromptTemplateRegistry
Methods
GetAsync(string, string?, IExchange?, CancellationToken)
Returns the requested template. When version is null,
Task<PromptTemplate?> GetAsync(string name, string? version = null, IExchange? exchange = null, CancellationToken ct = default)
ListAsync(IExchange?, CancellationToken)
Enumerates every version of every template — used for tooling.
Task<IReadOnlyList<PromptTemplate>> ListAsync(IExchange? exchange = null, CancellationToken ct = default)
SetAsync(PromptTemplate, IExchange?, CancellationToken)
Registers or updates a template version.
Task SetAsync(PromptTemplate template, IExchange? exchange = null, CancellationToken ct = default)