InMemoryAssetTracker

class InMemoryAssetTracker(initialAssets: Collection<Asset> = emptyList()) : AssetTracker

Simple in-memory implementation of AssetTracker for testing and ephemeral use cases.

Constructors

Link copied to clipboard
constructor(initialAssets: Collection<Asset> = emptyList())

Properties

Link copied to clipboard
open override val assets: List<Asset>

All tracked assets, in order in which they were added

Functions

Link copied to clipboard
open fun addAnyReturnedAssets(tools: List<Tool>): List<Tool>

Make these tools track any assets produced.

Link copied to clipboard
open override fun addAsset(asset: Asset)

Add an asset to be tracked. If the asset is already being tracked, do nothing.

Link copied to clipboard
open fun addReturnedAssets(tool: Tool): Tool

Wrap a tool so any outputs are tracked as assets.

Link copied to clipboard
open fun mostRecent(n: Int): AssetView

The most recently timestamped assets

Link copied to clipboard

The most recently added assets

Link copied to clipboard

Convenience method to return references. References will be converted to matryoshka tools

Link copied to clipboard
open fun since(instant: Instant): AssetView

Assets timestamped since the given instant