Package 

Interface ChatAiComponentFactory


  • 
    public interface ChatAiComponentFactory
    
                        

    Factory that creates the components rendered inside the AI chat UI.

    Every slot has a default implementation, so you only override the ones you want to change. Provide a custom factory through LocalChatAiComponentFactory, usually with CompoundChatAiComponentFactory, to customize the components within a part of the composition. When no factory is provided, components fall back to DefaultChatAiComponentFactory, so they work without any setup.

    • Method Detail

      • ComposerLeadingContent

        @Composable() Unit ComposerLeadingContent(RowScope $self, ComposerLeadingContentParams params)

        The content rendered to the left of the input field in ChatComposer.

        The default renders a button that opens the system photo picker.

        Parameters:
        params - The parameters for the leading content.
      • ComposerInputTrailingContent

        @Composable() Unit ComposerInputTrailingContent(RowScope $self, ComposerInputTrailingContentParams params)

        The content rendered inside the input field of ChatComposer, after the text and before the send/stop button.

        The default renders a SpeechToTextButton that dictates into the field while no response is generating. Override it to show something else there, or render nothing to leave dictation out.

        Parameters:
        params - The parameters for the input trailing content.
      • ComposerTrailingContent

        @Composable() Unit ComposerTrailingContent(RowScope $self, ComposerTrailingContentParams params)

        The content rendered to the right of the input field in ChatComposer.

        Empty by default. Override to add custom trailing controls.

        Parameters:
        params - The parameters for the trailing content.
      • AITypingIndicatorLabel

        @Composable() Unit AITypingIndicatorLabel(AITypingIndicatorLabelParams params)

        The label rendered before the indicator in AITypingIndicator.

        Empty by default. Override to provide a label applied wherever AITypingIndicator is used.

        Parameters:
        params - The parameters for the label content.
      • AISuggestionsChip

        @Composable() Unit AISuggestionsChip(AISuggestionsChipParams params)

        A chip rendered in AISuggestions.

        The default renders a Material 3 androidx.compose.material3.SuggestionChip that shows the text on up to 2 lines. The row gives every chip the same height (the minimum height it receives) and limits its width to AISuggestions's itemMaxWidth.

        Parameters:
        params - The parameters for the chip.