Search Results for

    Show / Hide Table of Contents

    Interface IToolRouter

    Selects which tools to forward to the LLM for a given user message. Implement this interface to provide a custom routing strategy (e.g. rule-based, tag-based, or embedding-based).

    Namespace: Glitch9.AIDevKit.Agents
    Assembly: Glitch9.AIDevKit.dll
    Syntax
    public interface IToolRouter

    Methods

    | Edit this page View Source

    Initialize(ToolRegistry, ILogger)

    Declaration
    void Initialize(ToolRegistry registry, ILogger logger)
    Parameters
    Type Name Description
    ToolRegistry registry
    ILogger logger
    | Edit this page View Source

    Invalidate()

    Notifies the router that the registered tool list has changed and any cached state (e.g. an embedding index) should be rebuilt on the next call.

    Declaration
    void Invalidate()
    | Edit this page View Source

    RouteAsync(string, int, CancellationToken)

    Returns the subset of tools most relevant to userMessage.

    Declaration
    UniTask<List<Tool>> RouteAsync(string userMessage, int topK = 12, CancellationToken ct = default)
    Parameters
    Type Name Description
    string userMessage

    The user's latest text input.

    int topK

    Maximum number of tools to return.

    CancellationToken ct

    Cancellation token.

    Returns
    Type Description
    UniTask<List<Tool>>

    Extension Methods

    ArrayExtensions.ToArrayOrEmpty<T>(T)
    ArrayExtensions.ToArrayOrNull<T>(T)
    EventExtensions.ToDelta<T>(T, string, int, string, bool)
    EventExtensions.ToDone<T>(T, string, int, string)
    EventExtensions.ToEvent<T>(T)
    EventExtensions.UpcastDelta<T1, T2>(T1, string, int, string, bool)
    FallbackExtensions.IsOr<TParent, TChild>(TParent, TChild)
    ResponseCastingExtensions.GetResult<T>(T)
    SystemExtensions.GetName(object)
    • Edit this page
    • View Source
    In this article
    Back to top AI DevKit Documentation