Class LlmServiceCollectionExtensions
Extension methods for registering the LLM transport, governance defaults
and redb-backed storage in a DI container.
public static class LlmServiceCollectionExtensions
Inheritance
Methods
AddLlmConnectionFactory(IServiceCollection, string, Action<LlmConnectionFactory>)
Registers a named in the route registry.
public static IServiceCollection AddLlmConnectionFactory(this IServiceCollection services, string name, Action<LlmConnectionFactory> configure)
AddLlmTool(IServiceCollection, ILlmToolDescriptor)
Registers an already-constructed instance.
public static IServiceCollection AddLlmTool(this IServiceCollection services, ILlmToolDescriptor descriptor)
AddLlmTool<TTool>(IServiceCollection)
Registers an implementation as a DI singleton.
public static IServiceCollection AddLlmTool<TTool>(this IServiceCollection services) where TTool : class, ILlmToolDescriptor
AddLlmToolsFromAssemblies(IServiceCollection, params Assembly[])
Scans assemblies for non-abstract
public static IServiceCollection AddLlmToolsFromAssemblies(this IServiceCollection services, params Assembly[] assemblies)
AddLlmToolsFromType(IServiceCollection, Type, Func<string, string>?)
Non-generic overload of .
public static IServiceCollection AddLlmToolsFromType(this IServiceCollection services, Type type, Func<string, string>? endpointUriFactory = null)
AddLlmToolsFromType<T>(IServiceCollection, Func<string, string>?)
Scans T for class-level and method-level
public static IServiceCollection AddLlmToolsFromType<T>(this IServiceCollection services, Func<string, string>? endpointUriFactory = null)
AddRedbLlmStorage(IServiceCollection, string)
with the agent's memory in the named redb instance
public static IServiceCollection AddRedbLlmStorage(this IServiceCollection services, string redbName)
AddRedbLlmStorage(IServiceCollection)
Replaces the in-memory storage fallbacks with redb-backed implementations of
public static IServiceCollection AddRedbLlmStorage(this IServiceCollection services)
AddRedbRouteLlm(IServiceCollection)
Registers the LLM component, agent engine, tool registry and no-op
public static IServiceCollection AddRedbRouteLlm(this IServiceCollection services)