docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface IChatToolRenderer

    The seam through which an application renders its own tools.

    Namespace: Unity.AppUI.UI
    Assembly: Unity.AppUI.dll
    Syntax
    public interface IChatToolRenderer
    Remarks

    ChatMessages knows how to lay a conversation out, but not what any particular tool call should look like — that is a product decision, and the registry keeps it in a separate renderer registry. Implement this and hand it to toolRenderer to place bespoke content under the activity timeline. Returning null falls back to the timeline row alone, which is what happens when no renderer is set.

    Examples
    class DiffToolRenderer : IChatToolRenderer
    {
        public VisualElement CreateToolContent(ChatMessagePart call, object result)
        {
            if (call.toolName != "apply_patch")
                return null;
            return new CodeBlock { language = "diff", code = result as string };
        }
    }

    Methods

    CreateToolContent(ChatMessagePart, object)

    Builds the content shown for one tool call, or returns null to render nothing extra.

    Declaration
    VisualElement CreateToolContent(ChatMessagePart call, object result)
    Parameters
    Type Name Description
    ChatMessagePart call

    The ToolCall part.

    object result

    What the matching result carried, or null while the call is pending.

    Returns
    Type Description
    VisualElement

    The element to insert, or null.

    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)