-
public interface ChatAiComponentFactoryFactory 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 Summary
Modifier and Type Method Description UnitComposerLeadingContent(RowScope $self, ComposerLeadingContentParams params)The content rendered to the left of the input field in ChatComposer. UnitComposerInputContent(RowScope $self, ComposerInputContentParams params)The input field of ChatComposer, including the speech-to-text and send/stop controls. UnitComposerInputTrailingContent(RowScope $self, ComposerInputTrailingContentParams params)The content rendered inside the input field of ChatComposer, after the text and before the send/stop button. UnitComposerTrailingContent(RowScope $self, ComposerTrailingContentParams params)The content rendered to the right of the input field in ChatComposer. UnitAITypingIndicatorLabel(AITypingIndicatorLabelParams params)The label rendered before the indicator in AITypingIndicator. UnitAITypingIndicatorIndicator(AITypingIndicatorIndicatorParams params)The animated indicator rendered in AITypingIndicator. UnitSpeechToTextButtonIdleContent(SpeechToTextButtonIdleContentParams params)The idle content of SpeechToTextButton, shown when not recording. UnitSpeechToTextButtonRecordingContent(SpeechToTextButtonRecordingContentParams params)The recording content of SpeechToTextButton, shown while recording. UnitAISuggestionsChip(AISuggestionsChipParams params)A chip rendered in AISuggestions. -
-
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.
-
ComposerInputContent
@Composable() Unit ComposerInputContent(RowScope $self, ComposerInputContentParams params)
The input field of ChatComposer, including the speech-to-text and send/stop controls.
The default renders the text field with ComposerInputTrailingContent (the voice button) and the send/stop button.
- Parameters:
params- The parameters for the input 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.
-
AITypingIndicatorIndicator
@Composable() Unit AITypingIndicatorIndicator(AITypingIndicatorIndicatorParams params)
The animated indicator rendered in AITypingIndicator.
The default renders three animated dots.
- Parameters:
params- The parameters for the indicator content.
-
SpeechToTextButtonIdleContent
@Composable() Unit SpeechToTextButtonIdleContent(SpeechToTextButtonIdleContentParams params)
The idle content of SpeechToTextButton, shown when not recording.
The default renders a microphone icon button.
- Parameters:
params- The parameters for the idle content.
-
SpeechToTextButtonRecordingContent
@Composable() Unit SpeechToTextButtonRecordingContent(SpeechToTextButtonRecordingContentParams params)
The recording content of SpeechToTextButton, shown while recording.
The default renders animated bars that respond to the audio level.
- Parameters:
params- The parameters for the recording 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.
-
-
-
-