18 lines
No EOL
552 B
Kotlin
18 lines
No EOL
552 B
Kotlin
package com.mistral.chat.data
|
|
|
|
data class UserProfile(
|
|
val name: String = "",
|
|
val bio: String = "",
|
|
val preferences: String = ""
|
|
) {
|
|
fun isEmpty(): Boolean = name.isBlank() && bio.isBlank() && preferences.isBlank()
|
|
|
|
fun toContextString(): String {
|
|
return buildString {
|
|
append("[User Profile]\n")
|
|
if (name.isNotBlank()) append("Name: $name\n")
|
|
if (bio.isNotBlank()) append("Bio: $bio\n")
|
|
if (preferences.isNotBlank()) append("Preferences: $preferences\n")
|
|
}
|
|
}
|
|
} |