Share via


CachedFoundryToolCatalog Class

Definition

Base implementation of IFoundryToolCatalog with TTL-based caching. Provides concurrency-safe tool metadata caching to optimize repeated tool lookups.

public abstract class CachedFoundryToolCatalog : Azure.AI.AgentServer.Core.Tools.Runtime.Catalog.IFoundryToolCatalog, IDisposable
type CachedFoundryToolCatalog = class
    interface IFoundryToolCatalog
    interface IDisposable
Public MustInherit Class CachedFoundryToolCatalog
Implements IDisposable, IFoundryToolCatalog
Inheritance
CachedFoundryToolCatalog
Derived
Implements

Constructors

Name Description
CachedFoundryToolCatalog(Nullable<TimeSpan>, Int64)

Initializes a new instance of the CachedFoundryToolCatalog class.

Methods

Name Description
ClearCache()

Clears all cached tool metadata. Useful for testing or manual cache invalidation.

Dispose()

Disposes the catalog and releases resources.

Dispose(Boolean)

Disposes the catalog and releases resources.

FetchToolsAsync(IReadOnlyList<FoundryTool>, UserInfo, CancellationToken)

Fetches tool details from the underlying source. Derived classes must implement this method to provide the actual tool data.

GetAsync(Object, CancellationToken)

Gets a single resolved tool by its definition.

GetUserContextAsync(CancellationToken)

Gets the user context for the current request. Derived classes may override this to provide custom user resolution. Default implementation returns null.

ListAsync(IEnumerable<Object>, CancellationToken)

Lists multiple resolved tools by their definitions. Uses Task-based deduplication to prevent concurrent fetches of the same tool.

Applies to