CompoundChatAiComponentFactory

Builds a compound ChatAiComponentFactory by wrapping the current factory and provides it to content through LocalChatAiComponentFactory.

Use this to override some components while keeping the rest, without rebuilding the whole factory:

CompoundChatAiComponentFactory(
factory = { current ->
object : ChatAiComponentFactory by current {
@Composable
override fun RowScope.ComposerLeadingContent(params: ComposerLeadingContentParams) {
// Render nothing to hide the attachment button.
}
}
},
) {
ChatComposer(/* ... */)
}

Parameters

keys

Keys that control recomposition. When any key changes, factory runs again to build a new compound factory.

factory

Builds a new ChatAiComponentFactory from the current one.

content

The content that uses the compound factory.