docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class ChatStreamingIndicator

    The "the agent is working" line shown above a streaming answer.

    Inheritance
    object
    CallbackEventHandler
    Focusable
    VisualElement
    BaseVisualElement
    ChatStreamingIndicator
    Implements
    IEventHandler
    IResolvedStyle
    ITransform
    ITransitionAnimations
    IExperimentalFeatures
    IVisualElementScheduler
    IContextOverrideElement
    IAdditionalDataHolder
    Inherited Members
    BaseVisualElement.contextPrefix
    BaseVisualElement.densityOverride
    BaseVisualElement.themeOverride
    BaseVisualElement.langOverride
    BaseVisualElement.layoutDirectionOverride
    BaseVisualElement.preferredTooltipPlacementOverride
    BaseVisualElement.tooltipDelayMsOverride
    BaseVisualElement.GetLayoutDirectionUssClassName(Dir)
    VisualElement.disabledUssClassName
    VisualElement.SetActivePseudoState(bool)
    VisualElement.SetCheckedPseudoState(bool)
    VisualElement.Focus()
    VisualElement.SendEvent(EventBase)
    VisualElement.SetEnabledFromHierarchy(bool)
    VisualElement.SetEnabled(bool)
    VisualElement.MarkDirtyRepaint()
    VisualElement.IsMarkedForRepaint()
    VisualElement.ContainsPoint(Vector2)
    VisualElement.Overlaps(Rect)
    VisualElement.DoMeasure(float, VisualElement.MeasureMode, float, VisualElement.MeasureMode)
    VisualElement.ToString()
    VisualElement.GetClasses()
    VisualElement.ClearClassList()
    VisualElement.AddToClassList(string)
    VisualElement.RemoveFromClassList(string)
    VisualElement.ToggleInClassList(string)
    VisualElement.EnableInClassList(string, bool)
    VisualElement.ClassListContains(string)
    VisualElement.FindAncestorUserData()
    VisualElement.SetBinding(BindingId, Binding)
    VisualElement.GetBinding(BindingId)
    VisualElement.TryGetBinding(BindingId, out Binding)
    VisualElement.GetBindingInfos()
    VisualElement.GetBindingInfos(List<BindingInfo>)
    VisualElement.HasBinding(BindingId)
    VisualElement.ClearBinding(BindingId)
    VisualElement.ClearBindings()
    VisualElement.GetHierarchicalDataSourceContext()
    VisualElement.GetDataSourceContext(BindingId)
    VisualElement.TryGetDataSourceContext(BindingId, out DataSourceContext)
    VisualElement.TryGetLastBindingToUIResult(in BindingId, out BindingResult)
    VisualElement.TryGetLastBindingToSourceResult(in BindingId, out BindingResult)
    VisualElement.Add(VisualElement)
    VisualElement.Insert(int, VisualElement)
    VisualElement.Remove(VisualElement)
    VisualElement.RemoveAt(int)
    VisualElement.Clear()
    VisualElement.ElementAt(int)
    VisualElement.IndexOf(VisualElement)
    VisualElement.Children()
    VisualElement.Sort(Comparison<VisualElement>)
    VisualElement.BringToFront()
    VisualElement.SendToBack()
    VisualElement.PlaceBehind(VisualElement)
    VisualElement.PlaceInFront(VisualElement)
    VisualElement.RemoveFromHierarchy()
    VisualElement.GetFirstOfType<T>()
    VisualElement.GetFirstAncestorOfType<T>()
    VisualElement.Contains(VisualElement)
    VisualElement.FindCommonAncestor(VisualElement)
    VisualElement.viewDataKey
    VisualElement.userData
    VisualElement.canGrabFocus
    VisualElement.focusController
    VisualElement.disablePlayModeTint
    VisualElement.usageHints
    VisualElement.transform
    VisualElement.scaledPixelsPerPoint
    VisualElement.layout
    VisualElement.contentRect
    VisualElement.paddingRect
    VisualElement.worldBound
    VisualElement.localBound
    VisualElement.worldTransform
    VisualElement.hasActivePseudoState
    VisualElement.hasInactivePseudoState
    VisualElement.hasHoverPseudoState
    VisualElement.hasCheckedPseudoState
    VisualElement.hasEnabledPseudoState
    VisualElement.hasDisabledPseudoState
    VisualElement.hasFocusPseudoState
    VisualElement.hasRootPseudoState
    VisualElement.pickingMode
    VisualElement.name
    VisualElement.enabledInHierarchy
    VisualElement.enabledSelf
    VisualElement.languageDirection
    VisualElement.visible
    VisualElement.generateVisualContent
    VisualElement.dataSource
    VisualElement.dataSourcePath
    VisualElement.dataSourceType
    VisualElement.experimental
    VisualElement.hierarchy
    VisualElement.cacheAsBitmap
    VisualElement.parent
    VisualElement.panel
    VisualElement.contentContainer
    VisualElement.visualTreeAssetSource
    VisualElement.this[int]
    VisualElement.childCount
    VisualElement.schedule
    VisualElement.style
    VisualElement.resolvedStyle
    VisualElement.customStyle
    VisualElement.styleSheets
    VisualElement.tooltip
    Focusable.Blur()
    Focusable.focusable
    Focusable.tabIndex
    Focusable.delegatesFocus
    CallbackEventHandler.RegisterCallback<TEventType>(EventCallback<TEventType>, TrickleDown)
    CallbackEventHandler.RegisterCallbackOnce<TEventType>(EventCallback<TEventType>, TrickleDown)
    CallbackEventHandler.RegisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TUserArgsType, TrickleDown)
    CallbackEventHandler.RegisterCallbackOnce<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TUserArgsType, TrickleDown)
    CallbackEventHandler.RegisterCallback<TEventType>(EventCallback<TEventType>, CallbackOptions)
    CallbackEventHandler.RegisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TUserArgsType, CallbackOptions)
    CallbackEventHandler.UnregisterCallback<TEventType>(EventCallback<TEventType>, TrickleDown)
    CallbackEventHandler.UnregisterCallback<TEventType>(EventCallback<TEventType>, CallbackOptions)
    CallbackEventHandler.UnregisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TrickleDown)
    CallbackEventHandler.UnregisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, CallbackOptions)
    CallbackEventHandler.UnregisterAllRemovableCallbacks()
    CallbackEventHandler.HasTrickleDownHandlers()
    CallbackEventHandler.HasBubbleUpHandlers()
    CallbackEventHandler.ExecuteDefaultActionAtTarget(EventBase)
    CallbackEventHandler.HandleEventBubbleUp(EventBase)
    CallbackEventHandler.HandleEventTrickleDown(EventBase)
    CallbackEventHandler.ExecuteDefaultAction(EventBase)
    CallbackEventHandler.NotifyPropertyChanged(in BindingId)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: Unity.AppUI.UI
    Assembly: Unity.AppUI.dll
    Syntax
    [UxmlElement]
    public class ChatStreamingIndicator : BaseVisualElement, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IContextOverrideElement, IAdditionalDataHolder
    Remarks

    While streaming, the indicator shows the Unity mark filling itself in next to a present-tense verb, for instance "Thinking". Once completed is set it settles into the solid mark and the past tense with the duration, for instance "Thought for 6s".

    The animation is not this component's: it is the Animated variant of UnityLogo, which already owns a scheduled fill driver that starts on attach and stops on detach. This element only swaps the variant, so there is exactly one animation driver in the package rather than two.

    The verb pair is picked at random when the indicator is constructed, the same way the web implementation picks one per message, so a long conversation does not read as a stuck loop. verbIndex pins it when you need a deterministic rendering.

    durationMs is optional. Left at unknownDuration, the completed line reports how long the indicator itself was on screen; set it when the caller already knows the real duration of the turn.

    Examples

    A live indicator, with optional stats in parentheses.

    var indicator = new ChatStreamingIndicator { stats = "2 tools • 1.2k tokens" };
    parentElement.Add(indicator);

    Settling it when the turn is over.

    indicator.durationMs = 6400;
    indicator.completed = true;

    In UXML.

    <appui:ChatStreamingIndicator />
    <appui:ChatStreamingIndicator completed="true" duration-ms="90000" />

    Constructors

    ChatStreamingIndicator()

    Default constructor.

    Declaration
    public ChatStreamingIndicator()

    Fields

    completedUssClassName

    The styling class applied once the turn is over.

    Declaration
    public const string completedUssClassName = "appui-chat-streaming-indicator--completed"
    Field Value
    Type Description
    string

    iconUssClassName

    The styling class applied to a custom icon.

    Declaration
    public const string iconUssClassName = "appui-chat-streaming-indicator__icon"
    Field Value
    Type Description
    string

    labelUssClassName

    The styling class of the verb label.

    Declaration
    public const string labelUssClassName = "appui-chat-streaming-indicator__label"
    Field Value
    Type Description
    string

    logoUssClassName

    The styling class of the Unity mark.

    Declaration
    public const string logoUssClassName = "appui-chat-streaming-indicator__logo"
    Field Value
    Type Description
    string

    statsUssClassName

    The styling class of the trailing stats.

    Declaration
    public const string statsUssClassName = "appui-chat-streaming-indicator__stats"
    Field Value
    Type Description
    string

    unknownDuration

    The value of durationMs that means "nobody told me, measure it yourself".

    Declaration
    public const int unknownDuration = -1
    Field Value
    Type Description
    int

    ussClassName

    The ChatStreamingIndicator main styling class.

    Declaration
    public const string ussClassName = "appui-chat-streaming-indicator"
    Field Value
    Type Description
    string

    verbUssClassName

    The styling class applied to the element renderVerb returns.

    Declaration
    public const string verbUssClassName = "appui-chat-streaming-indicator__verb"
    Field Value
    Type Description
    string

    Properties

    completed

    Whether the turn is over. False by default.

    Declaration
    [CreateProperty]
    [UxmlAttribute]
    public bool completed { get; set; }
    Property Value
    Type Description
    bool
    Remarks

    Flipping this to true freezes the measured elapsed time, so a completed indicator does not keep counting up while it stays on screen.

    durationMs

    How long the turn took, in milliseconds. unknownDuration by default, which makes the indicator report its own on-screen time instead.

    Declaration
    [CreateProperty]
    [UxmlAttribute]
    public int durationMs { get; set; }
    Property Value
    Type Description
    int

    icon

    A mark shown before the verb in place of the Unity logo, in both states. Null, the default, keeps the logo.

    Declaration
    [CreateProperty]
    public VisualElement icon { get; set; }
    Property Value
    Type Description
    VisualElement
    Remarks

    The registry's icon. While a custom mark is set the logo is hidden and held on its filled variant, so its animation driver does not run behind it.

    label

    The line the indicator currently reads.

    Declaration
    public string label { get; }
    Property Value
    Type Description
    string

    logo

    The Unity mark the indicator animates.

    Declaration
    public UnityLogo logo { get; }
    Property Value
    Type Description
    UnityLogo

    renderVerb

    Renders the live verb ("Considering") as an element of the host's own, so it can give the verb a treatment of its own. Null, the default, keeps the verb under the sweep.

    Declaration
    [CreateProperty]
    public Func<string, VisualElement> renderVerb { get; set; }
    Property Value
    Type Description
    Func<string, VisualElement>
    Remarks

    The registry's renderVerb. The rendered element replaces the sweep rather than wrapping it: both paint the text, and two would fight. It is used only while the turn runs; the completed line ("Considered for 6s") stays plain. A function that returns null renders no verb at all, rather than bringing the sweep back.

    The function builds an element, so it runs when the verb changes or the function is replaced, not on every refresh: a stats update does not rebuild the verb.

    startTime

    When the turn started, so the elapsed time survives the element being rebuilt.

    Declaration
    [CreateProperty]
    public DateTime? startTime { get; set; }
    Property Value
    Type Description
    DateTime?
    Remarks

    Unset, the indicator measures from its own construction, which is right for an element that lives as long as the turn. A host that rebuilds its message list mid-turn destroys and recreates this element, and a construction-time origin would restart the count from zero every time; handing the message's own createdAt in keeps it honest. This is the registry's startTimeMs, in the wall-clock currency the rest of the chat suite already speaks.

    It is deliberately a wall clock rather than the frame clock the fallback uses. A frame clock has no meaning across the rebuild this property exists to survive.

    stats

    Extra detail shown in parentheses while streaming, for instance "2 tools • 1.2k tokens". Null or empty hides the trailing element entirely.

    Declaration
    [CreateProperty]
    [UxmlAttribute]
    public string stats { get; set; }
    Property Value
    Type Description
    string

    verbIndex

    Which verb pair the indicator uses, as an index into verbs. Randomized at construction; set it to pin the wording.

    Declaration
    [CreateProperty]
    [UxmlAttribute]
    public int verbIndex { get; set; }
    Property Value
    Type Description
    int

    Implements

    IEventHandler
    IResolvedStyle
    ITransform
    ITransitionAnimations
    IExperimentalFeatures
    IVisualElementScheduler
    IContextOverrideElement
    IAdditionalDataHolder

    Extension Methods

    VisualElementExtensions.FindNavController(VisualElement)
    RegisterUpdateCallbackExtensions.RegisterUpdateCallback(VisualElement, EventCallback<UpdateEvent>)
    RegisterUpdateCallbackExtensions.UnregisterUpdateCallback(VisualElement, EventCallback<UpdateEvent>)
    VisualElementExtensions.EnableDynamicTransform(VisualElement, bool)
    VisualElementExtensions.EnablePicking(VisualElement, bool)
    VisualElementExtensions.GetChildren<T>(VisualElement, bool)
    VisualElementExtensions.GetContextProvider<T>(VisualElement)
    VisualElementExtensions.GetContextProvider<T>(VisualElement, string)
    VisualElementExtensions.GetContext<T>(VisualElement)
    VisualElementExtensions.GetContext<T>(VisualElement, string)
    VisualElementExtensions.GetExclusiveRootElement(VisualElement)
    VisualElementExtensions.GetLastAncestorOfType<T>(VisualElement)
    VisualElementExtensions.GetPreferredTooltipPlacement(VisualElement)
    VisualElementExtensions.GetSelfContext<T>(VisualElement)
    VisualElementExtensions.GetSelfContext<T>(VisualElement, string)
    VisualElementExtensions.GetTooltipContent(VisualElement)
    VisualElementExtensions.GetTooltipTemplate(VisualElement)
    VisualElementExtensions.HasAncestorOfType<T>(VisualElement, bool)
    VisualElementExtensions.HasAncestorsOfType<T>(VisualElement)
    VisualElementExtensions.IsContextProvider<T>(VisualElement)
    VisualElementExtensions.IsContextProvider<T>(VisualElement, string)
    VisualElementExtensions.IsInvisible(VisualElement)
    VisualElementExtensions.IsOnScreen(VisualElement)
    VisualElementExtensions.ProvideContext<T>(VisualElement, string, T)
    VisualElementExtensions.ProvideContext<T>(VisualElement, T)
    VisualElementExtensions.RegisterContextChangedCallback<T>(VisualElement, string, EventCallback<ContextChangedEvent<T>>)
    VisualElementExtensions.RegisterContextChangedCallback<T>(VisualElement, EventCallback<ContextChangedEvent<T>>)
    VisualElementExtensions.SetPreferredTooltipPlacement(VisualElement, OptionalEnum<PopoverPlacement>)
    VisualElementExtensions.SetTooltipContent(VisualElement, VisualElementExtensions.TooltipContentCallback)
    VisualElementExtensions.SetTooltipTemplate(VisualElement, VisualElement)
    VisualElementExtensions.UnregisterContextChangedCallback<T>(VisualElement, string, EventCallback<ContextChangedEvent<T>>)
    VisualElementExtensions.UnregisterContextChangedCallback<T>(VisualElement, EventCallback<ContextChangedEvent<T>>)
    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)