File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed
examples/demo-compose-app
src/commonMain/kotlin/com/jetbrains/example/koog/compose/screens/agentdemo Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ kotlin {
4949 implementation(libs.koog.prompt.executor.llms.all)
5050 implementation(libs.kotlinx.coroutines.core)
5151 implementation(libs.kotlinx.datetime)
52+ implementation(libs.markdown.renderer)
5253 implementation(libs.kotlinx.serialization.core)
5354 implementation(libs.kotlinx.serialization.json)
5455 implementation(project.dependencies.platform(libs.koin.bom))
Original file line number Diff line number Diff line change @@ -51,6 +51,9 @@ import androidx.compose.ui.text.input.ImeAction
5151import androidx.compose.ui.unit.dp
5252import com.jetbrains.example.koog.compose.theme.AppDimension
5353import com.jetbrains.example.koog.compose.theme.AppTheme
54+ import com.mikepenz.markdown.m3.Markdown
55+ import com.mikepenz.markdown.m3.markdownColor
56+ import com.mikepenz.markdown.m3.markdownTypography
5457import org.jetbrains.compose.ui.tooling.preview.Preview
5558
5659@Composable
@@ -202,10 +205,10 @@ private fun AgentMessageBubble(text: String) {
202205 .background(MaterialTheme .colorScheme.primaryContainer)
203206 .padding(AppDimension .spacingMedium)
204207 ) {
205- Text (
206- text = text,
207- color = MaterialTheme .colorScheme.onPrimaryContainer,
208- style = MaterialTheme .typography.bodyLarge
208+ Markdown (
209+ content = text,
210+ colors = markdownColor(text = MaterialTheme .colorScheme.onPrimaryContainer) ,
211+ typography = markdownTypography(text = MaterialTheme .typography.bodyLarge)
209212 )
210213 }
211214 }
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ kotlinx-datetime = "0.7.1-0.6.x-compat"
1515kotlinx-serialization = " 1.9.0"
1616ktlint = " 14.0.1"
1717ktor = " 3.3.2"
18+ markdown-renderer = " 0.38.1"
1819
1920[libraries ]
2021androidx-activityCompose = { module = " androidx.activity:activity-compose" , version.ref = " androidx-activityCompose" }
@@ -36,6 +37,7 @@ ktor-client-apache5 = { module = "io.ktor:ktor-client-apache5" }
3637ktor-client-darwin = { module = " io.ktor:ktor-client-darwin" }
3738ktor-client-js = { module = " io.ktor:ktor-client-js" }
3839ktor-client-okhttp = { module = " io.ktor:ktor-client-okhttp" }
40+ markdown-renderer = { module = " com.mikepenz:multiplatform-markdown-renderer-m3" , version.ref = " markdown-renderer" }
3941
4042[plugins ]
4143android-application = { id = " com.android.application" , version.ref = " agp" }
You can’t perform that action at this time.
0 commit comments