Fix OpenClaw Mem0 custom categories payload (#5345)

Co-authored-by: Kartik <kartik.labhshetwar@mem0.ai>
This commit is contained in:
mjzcng
2026-06-12 19:48:53 +05:30
committed by GitHub
co-authored by Kartik
parent f48b133101
commit 821152bd14
4 changed files with 94 additions and 4 deletions
+10
View File
@@ -13,6 +13,16 @@ import type {
AddResult,
} from "./types.ts";
export function customCategoryMapToList(
categories?: Record<string, string>,
): Array<Record<string, string>> | undefined {
if (!categories || typeof categories !== "object") return undefined;
const items = Object.entries(categories).map(([name, description]) => ({
[name]: description,
}));
return items.length ? items : undefined;
}
// ============================================================================
// Result Normalizers
// ============================================================================