Initial commit
This commit is contained in:
commit
cda6eb7ce0
680 changed files with 75081 additions and 0 deletions
27
app/src/main/java/com/mistral/chat/data/Message.kt
Normal file
27
app/src/main/java/com/mistral/chat/data/Message.kt
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
package com.mistral.chat.data
|
||||
|
||||
data class Message(
|
||||
val id: String = System.currentTimeMillis().toString(),
|
||||
val content: String,
|
||||
val isUser: Boolean,
|
||||
val timestamp: Long = System.currentTimeMillis(),
|
||||
val senderName: String? = null
|
||||
)
|
||||
|
||||
data class ChatRequest(
|
||||
val model: String,
|
||||
val messages: List<Message>,
|
||||
val temperature: Double = 0.7,
|
||||
val stream: Boolean = false
|
||||
)
|
||||
|
||||
data class ChatResponse(
|
||||
val id: String,
|
||||
val choices: List<Choice>,
|
||||
val model: String
|
||||
)
|
||||
|
||||
data class Choice(
|
||||
val index: Int,
|
||||
val message: Message
|
||||
)
|
||||
17
app/src/main/java/com/mistral/chat/data/UserProfile.kt
Normal file
17
app/src/main/java/com/mistral/chat/data/UserProfile.kt
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
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 {
|
||||
if (name.isNotBlank()) append("Name: $name\n")
|
||||
if (bio.isNotBlank()) append("Bio: $bio\n")
|
||||
if (preferences.isNotBlank()) append("Preferences: $preferences\n")
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue