@kalera/munin-sdk 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +1 -1
- package/dist/client.js +14 -2
- package/package.json +1 -1
- package/src/client.ts +14 -2
package/.turbo/turbo-build.log
CHANGED
package/dist/client.js
CHANGED
|
@@ -93,6 +93,14 @@ export class MuninClient {
|
|
|
93
93
|
return mem;
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
|
+
// Server 'search' action returns 'memories' instead of 'results'
|
|
97
|
+
if (Array.isArray(data.memories)) {
|
|
98
|
+
data.memories = data.memories.map((mem) => {
|
|
99
|
+
if (mem.embedding)
|
|
100
|
+
delete mem.embedding;
|
|
101
|
+
return mem;
|
|
102
|
+
});
|
|
103
|
+
}
|
|
96
104
|
// Clean graph in search
|
|
97
105
|
if (data.knowledge_graph) {
|
|
98
106
|
data.knowledge_graph = this.formatGraph(data.knowledge_graph);
|
|
@@ -105,12 +113,16 @@ export class MuninClient {
|
|
|
105
113
|
const entities = (kg.entities || []).map((e) => {
|
|
106
114
|
if (e.embedding)
|
|
107
115
|
delete e.embedding;
|
|
108
|
-
return `${e.
|
|
116
|
+
return `${e.label || 'Unknown'} (${e.type || 'Unknown'}): ${e.description || ''}`;
|
|
109
117
|
});
|
|
118
|
+
// To make relationships readable without doing a separate map lookup,
|
|
119
|
+
// we use the sourceEntityId and targetEntityId directly or map if populated.
|
|
110
120
|
const relationships = (kg.relationships || []).map((r) => {
|
|
111
121
|
if (r.embedding)
|
|
112
122
|
delete r.embedding;
|
|
113
|
-
|
|
123
|
+
const source = r.sourceLabel || r.sourceEntityId || 'Unknown';
|
|
124
|
+
const target = r.targetLabel || r.targetEntityId || 'Unknown';
|
|
125
|
+
return `${source} -[${r.type || 'Unknown'}]-> ${target}`;
|
|
114
126
|
});
|
|
115
127
|
return {
|
|
116
128
|
summary: "GraphRAG knowledge formatted for readability",
|
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -131,6 +131,14 @@ export class MuninClient {
|
|
|
131
131
|
return mem;
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
|
+
|
|
135
|
+
// Server 'search' action returns 'memories' instead of 'results'
|
|
136
|
+
if (Array.isArray(data.memories)) {
|
|
137
|
+
data.memories = data.memories.map((mem: any) => {
|
|
138
|
+
if (mem.embedding) delete mem.embedding;
|
|
139
|
+
return mem;
|
|
140
|
+
});
|
|
141
|
+
}
|
|
134
142
|
|
|
135
143
|
// Clean graph in search
|
|
136
144
|
if (data.knowledge_graph) {
|
|
@@ -145,12 +153,16 @@ export class MuninClient {
|
|
|
145
153
|
|
|
146
154
|
const entities = (kg.entities || []).map((e: any) => {
|
|
147
155
|
if (e.embedding) delete e.embedding;
|
|
148
|
-
return `${e.
|
|
156
|
+
return `${e.label || 'Unknown'} (${e.type || 'Unknown'}): ${e.description || ''}`;
|
|
149
157
|
});
|
|
150
158
|
|
|
159
|
+
// To make relationships readable without doing a separate map lookup,
|
|
160
|
+
// we use the sourceEntityId and targetEntityId directly or map if populated.
|
|
151
161
|
const relationships = (kg.relationships || []).map((r: any) => {
|
|
152
162
|
if (r.embedding) delete r.embedding;
|
|
153
|
-
|
|
163
|
+
const source = r.sourceLabel || r.sourceEntityId || 'Unknown';
|
|
164
|
+
const target = r.targetLabel || r.targetEntityId || 'Unknown';
|
|
165
|
+
return `${source} -[${r.type || 'Unknown'}]-> ${target}`;
|
|
154
166
|
});
|
|
155
167
|
|
|
156
168
|
return {
|