mirror of
https://github.com/jie65535/JChatGPT.git
synced 2026-09-15 02:56:10 +08:00
profile: harden batch analysis and compaction
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
package top.jie65535.mirai.profile
|
||||
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
enum class ProfileCompactionDeleteReason {
|
||||
@SerialName("one_off")
|
||||
ONE_OFF,
|
||||
|
||||
@SerialName("over_specific")
|
||||
OVER_SPECIFIC,
|
||||
|
||||
@SerialName("transient")
|
||||
TRANSIENT,
|
||||
|
||||
@SerialName("not_profile")
|
||||
NOT_PROFILE,
|
||||
}
|
||||
|
||||
@Serializable
|
||||
data class ProfileCompactionMerge(
|
||||
@SerialName("item_refs")
|
||||
val itemRefs: List<String>,
|
||||
val content: String,
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class ProfileCompactionRewrite(
|
||||
@SerialName("item_ref")
|
||||
val itemRef: String,
|
||||
val content: String,
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class ProfileCompactionDelete(
|
||||
@SerialName("item_ref")
|
||||
val itemRef: String,
|
||||
val reason: ProfileCompactionDeleteReason,
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class ProfileCompactionResponse(
|
||||
val merges: List<ProfileCompactionMerge> = emptyList(),
|
||||
val rewrites: List<ProfileCompactionRewrite> = emptyList(),
|
||||
val deletes: List<ProfileCompactionDelete> = emptyList(),
|
||||
val summary: String = "",
|
||||
)
|
||||
|
||||
data class ProfileItemSupportStats(
|
||||
val count: Int,
|
||||
val firstSupportedAt: Int,
|
||||
val lastSupportedAt: Int,
|
||||
)
|
||||
|
||||
data class ProfileCompactionModelResult(
|
||||
val response: ProfileCompactionResponse,
|
||||
val rawResponse: String,
|
||||
val usage: ProfileTokenUsage,
|
||||
)
|
||||
|
||||
data class ProfileCompactionPlan(
|
||||
val reduction: ProfileReduction,
|
||||
val supportReassignments: Map<String, String>,
|
||||
val mergedGroups: Int,
|
||||
val rewrittenItems: Int,
|
||||
val deletedItems: Int,
|
||||
val skippedOperations: List<String> = emptyList(),
|
||||
)
|
||||
|
||||
data class ProfileCompactionReport(
|
||||
val userId: Long,
|
||||
val beforeItems: Int,
|
||||
val afterItems: Int,
|
||||
val mergedGroups: Int,
|
||||
val rewrittenItems: Int,
|
||||
val deletedItems: Int,
|
||||
val summaryChanged: Boolean,
|
||||
val skippedOperations: Int,
|
||||
val usage: ProfileTokenUsage,
|
||||
val profile: UserProfileSnapshot,
|
||||
)
|
||||
Reference in New Issue
Block a user