Memory screen: list, remember, change and forget over /api/v2/memories
CI / check (push) Canceled after 0s
CI / check (push) Canceled after 0s
Drawer › Memory (server f7f2ff2): GET/POST/PATCH/DELETE /memories. Newest first, plain text (a model may have written it; marked with the Model icon), the data group shown when there is more than one and offered when remembering a new one. A refusal (the limit, an empty text) is the server's sentence. Every word from the server's catalogue. ContractTest reads memories.json and memory.json; shots 28-memory (normal, small phone at 1.5x, empty). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
19 files changed
+480
-2
No files matched your search
@@ -15,6 +15,8 @@ import eu.llembas.android.api.JobsFrame
|
||||
import eu.llembas.android.api.LembasJson
|
||||
import eu.llembas.android.api.LiveReply
|
||||
import eu.llembas.android.api.Me
|
||||
import eu.llembas.android.api.MemoryEnvelope
|
||||
import eu.llembas.android.api.MemoryList
|
||||
import eu.llembas.android.api.Message
|
||||
import eu.llembas.android.api.Metrics
|
||||
import eu.llembas.android.api.ModelList
|
||||
@@ -58,6 +60,17 @@ class ContractTest {
|
||||
assertEquals("Waybread", read("folder", FolderEnvelope.serializer()).folder.name)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun theMemoriesAndOne() {
|
||||
val list = read("memories", MemoryList.serializer())
|
||||
val one = list.memories.single()
|
||||
assertEquals("Prefers lembas warm.", one.content)
|
||||
assertFalse(one.byModel)
|
||||
assertEquals("default", one.dataGroup.id)
|
||||
assertEquals(listOf("Default"), list.groups.map { it.name })
|
||||
assertEquals("mem1", read("memory", MemoryEnvelope.serializer()).memory.id)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun theVersionIsOneThisAppReads() {
|
||||
val version = LembasJson.parseToJsonElement(text("version")).toString()
|
||||
|
||||
@@ -8,10 +8,12 @@ import eu.llembas.android.api.AgentsSetting
|
||||
import eu.llembas.android.api.Attachment
|
||||
import eu.llembas.android.api.Chat
|
||||
import eu.llembas.android.api.ContextPart
|
||||
import eu.llembas.android.api.DataGroup
|
||||
import eu.llembas.android.api.Folder
|
||||
import eu.llembas.android.api.LembasJson
|
||||
import eu.llembas.android.api.LinkedDevice
|
||||
import eu.llembas.android.api.LiveReply
|
||||
import eu.llembas.android.api.Memory
|
||||
import eu.llembas.android.api.Message
|
||||
import eu.llembas.android.api.Metrics
|
||||
import eu.llembas.android.api.ModelList
|
||||
@@ -42,6 +44,7 @@ import eu.llembas.android.auth.Prefs
|
||||
import eu.llembas.android.ui.chat.ChatState
|
||||
import eu.llembas.android.ui.chat.Draft
|
||||
import eu.llembas.android.ui.home.ChatsState
|
||||
import eu.llembas.android.ui.memory.MemoryState
|
||||
import eu.llembas.android.ui.scheduled.EditState
|
||||
import eu.llembas.android.ui.scheduled.ModelsState
|
||||
import eu.llembas.android.ui.scheduled.RunState
|
||||
@@ -276,6 +279,21 @@ object Fakes {
|
||||
),
|
||||
)
|
||||
|
||||
// Memory: one the person wrote, two a model did, in two data groups.
|
||||
val memory = MemoryState(
|
||||
memories = listOf(
|
||||
Memory("m1", "Prefers lembas warm, with a little honey.", author = "user", dataGroup = DataGroup("default", "Default")),
|
||||
Memory(
|
||||
"m2",
|
||||
"Is walking to the mountain with three friends and asks for recipes that keep for weeks without spoiling on the road.",
|
||||
author = "model",
|
||||
dataGroup = DataGroup("default", "Default"),
|
||||
),
|
||||
Memory("m3", "Writes the garden's diary in Slovak.", author = "model", dataGroup = DataGroup("garden", "The garden")),
|
||||
),
|
||||
groups = listOf(DataGroup("default", "Default"), DataGroup("garden", "The garden")),
|
||||
)
|
||||
|
||||
private val home = Instance(id = "i1", base = "https://llm.example.org", name = "Home", email = "frodo@example.org", sealedToken = "")
|
||||
private val work = Instance(id = "i2", base = "https://ai.example.com", name = "Work", email = "f.baggins@example.com", sealedToken = "")
|
||||
|
||||
|
||||
@@ -33,6 +33,9 @@ import eu.llembas.android.ui.home.ArchivedContent
|
||||
import eu.llembas.android.ui.home.ChatsState
|
||||
import eu.llembas.android.ui.home.DrawerActions
|
||||
import eu.llembas.android.ui.home.DrawerContent
|
||||
import eu.llembas.android.ui.memory.MemoryActions
|
||||
import eu.llembas.android.ui.memory.MemoryContent
|
||||
import eu.llembas.android.ui.memory.MemoryState
|
||||
import eu.llembas.android.ui.scheduled.RunContent
|
||||
import eu.llembas.android.ui.scheduled.ScheduleContent
|
||||
import eu.llembas.android.ui.scheduled.ScheduleEditContent
|
||||
@@ -55,6 +58,8 @@ private object NoDrawerActions : DrawerActions
|
||||
|
||||
private object NoArchivedActions : ArchivedActions
|
||||
|
||||
private object NoMemoryActions : MemoryActions
|
||||
|
||||
private object NoActivityActions : ActivityActions
|
||||
|
||||
private object NoSettingsActions : SettingsActions
|
||||
@@ -244,6 +249,13 @@ class ScreenShots {
|
||||
shoot("27-archived", Phone.Small, fontScale = 1.5f) { ArchivedContent(Fakes.chats, NoArchivedActions) }
|
||||
shoot("27-archived-none") { ArchivedContent(ChatsState(), NoArchivedActions) }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun memory() {
|
||||
shoot("28-memory") { MemoryContent(Fakes.memory, NoMemoryActions) }
|
||||
shoot("28-memory", Phone.Small, fontScale = 1.5f) { MemoryContent(Fakes.memory, NoMemoryActions) }
|
||||
shoot("28-memory-none") { MemoryContent(MemoryState(), NoMemoryActions) }
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user