Class InMemoryToolCacheStore

Assembly: redb.Route.Llm.dll

In-memory tool cache. TTL is honoured lazily — entries are dropped on read.

public sealed class InMemoryToolCacheStore : IToolCacheStore

Inheritance

Object→InMemoryToolCacheStore

Implements

Methods

ClearAsync(IExchange?, CancellationToken)

Drops every entry — used by tests.

public ValueTask ClearAsync(IExchange? exchange = null, CancellationToken ct = default)

GetAsync(string, IExchange?, CancellationToken)

Returns the cached output for cacheKey, or null on a miss.

public ValueTask<string?> GetAsync(string cacheKey, IExchange? exchange = null, CancellationToken ct = default)

SetAsync(string, string, TimeSpan?, IExchange?, CancellationToken)

Stores the cached output and (optionally) sets a relative time-to-live.

public ValueTask SetAsync(string cacheKey, string outputJson, TimeSpan? ttl = null, IExchange? exchange = null, CancellationToken ct = default)