fixed memmory
This commit is contained in:
@@ -64,6 +64,30 @@ export interface CharacterCardV2 {
|
||||
data: CharacterCardData;
|
||||
}
|
||||
|
||||
export interface UserProfile {
|
||||
name?: string;
|
||||
age?: string;
|
||||
timezone?: string;
|
||||
language?: string;
|
||||
notes?: string;
|
||||
}
|
||||
|
||||
export interface MemoryFact {
|
||||
id: number;
|
||||
category: string;
|
||||
content: string;
|
||||
importance: number;
|
||||
source?: string;
|
||||
updated_at?: string | null;
|
||||
}
|
||||
|
||||
export interface MemorySnapshot {
|
||||
profile: UserProfile;
|
||||
facts: MemoryFact[];
|
||||
session_summary?: string;
|
||||
total_facts: number;
|
||||
}
|
||||
|
||||
export interface PomodoroHistoryItem {
|
||||
id: number;
|
||||
status: string;
|
||||
@@ -194,4 +218,31 @@ export const api = {
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify(card),
|
||||
}),
|
||||
|
||||
getMemorySnapshot: (sessionId?: number) =>
|
||||
request<MemorySnapshot>(
|
||||
`/api/v1/memory${sessionId ? `?session_id=${sessionId}` : ""}`
|
||||
),
|
||||
|
||||
updateProfile: (updates: UserProfile) =>
|
||||
request<{ ok: boolean; profile: UserProfile }>("/api/v1/profile", {
|
||||
method: "PUT",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ updates }),
|
||||
}),
|
||||
|
||||
createMemoryFact: (payload: {
|
||||
content: string;
|
||||
category?: string;
|
||||
importance?: number;
|
||||
session_id?: number;
|
||||
}) =>
|
||||
request<{ ok: boolean; memory_id: number }>("/api/v1/memory/facts", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify(payload),
|
||||
}),
|
||||
|
||||
forgetMemoryFact: (id: number) =>
|
||||
request<{ ok: boolean }>(`/api/v1/memory/facts/${id}`, { method: "DELETE" }),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user