add chat basics
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
/build
|
||||
/bin
|
||||
@@ -0,0 +1,16 @@
|
||||
plugins {
|
||||
alias(libs.plugins.convention.kmp)
|
||||
alias(libs.plugins.convention.android.lib)
|
||||
alias(libs.plugins.convention.serialization)
|
||||
}
|
||||
|
||||
kotlin {
|
||||
sourceSets {
|
||||
val commonMain by getting {
|
||||
dependencies {
|
||||
implementation(project(":libs:base"))
|
||||
}
|
||||
}
|
||||
}
|
||||
android { namespace = "ru.shadowsparky.chat.common" }
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package ru.shadowsparky.chat.domain
|
||||
|
||||
import kotlinx.coroutines.flow.Flow
|
||||
|
||||
interface ChatRepository {
|
||||
val messages: Flow<Message>
|
||||
|
||||
suspend fun sendMessage(message: Message)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package ru.shadowsparky.chat.domain
|
||||
|
||||
object ChatRoles {
|
||||
const val USER = "user"
|
||||
const val SYSTEM = "system"
|
||||
const val ASSISTANT = "assistant"
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package ru.shadowsparky.chat.domain
|
||||
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class Message(
|
||||
val id: Long? = null,
|
||||
val role: String,
|
||||
val content: String,
|
||||
val timestamp: Long
|
||||
)
|
||||
Reference in New Issue
Block a user