@heritageai/messaging 1.0.30 → 1.0.31
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/dist/events/knowledge-document-deleted-event.d.ts +3 -1
- package/dist/events/knowledge-document-indexed-event.d.ts +4 -5
- package/dist/events/knowledge-document-upserted-event.d.ts +7 -8
- package/dist/events/knowledge-query-requested-event.d.ts +3 -8
- package/dist/events/knowledge-query-responded-event.d.ts +4 -4
- package/package.json +1 -1
- package/src/events/knowledge-document-deleted-event.ts +3 -1
- package/src/events/knowledge-document-indexed-event.ts +4 -5
- package/src/events/knowledge-document-upserted-event.ts +13 -8
- package/src/events/knowledge-query-requested-event.ts +7 -8
- package/src/events/knowledge-query-responded-event.ts +10 -6
|
@@ -2,11 +2,10 @@ import { Subjects } from "../subjects";
|
|
|
2
2
|
export interface KnowledgeDocumentIndexedEvent {
|
|
3
3
|
subject: Subjects.KnowledgeDocumentIndexed;
|
|
4
4
|
data: {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
chunksIndexed?: number;
|
|
9
|
-
error?: string;
|
|
5
|
+
documentId: string;
|
|
6
|
+
siteId?: string;
|
|
7
|
+
chunks: number;
|
|
10
8
|
indexedAt: string;
|
|
9
|
+
correlationId: string;
|
|
11
10
|
};
|
|
12
11
|
}
|
|
@@ -2,14 +2,13 @@ import { Subjects } from "../subjects";
|
|
|
2
2
|
export interface KnowledgeDocumentUpsertedEvent {
|
|
3
3
|
subject: Subjects.KnowledgeDocumentUpserted;
|
|
4
4
|
data: {
|
|
5
|
-
|
|
6
|
-
source: "admin" | "site" | "asset";
|
|
7
|
-
title?: string;
|
|
8
|
-
text: string;
|
|
9
|
-
language?: string;
|
|
5
|
+
documentId: string;
|
|
10
6
|
siteId?: string;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
title: string;
|
|
8
|
+
language?: string;
|
|
9
|
+
text: string;
|
|
10
|
+
createdByUserId: string;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
correlationId: string;
|
|
14
13
|
};
|
|
15
14
|
}
|
|
@@ -4,15 +4,10 @@ export interface KnowledgeQueryRequestedEvent {
|
|
|
4
4
|
data: {
|
|
5
5
|
threadId: string;
|
|
6
6
|
userId: string;
|
|
7
|
-
correlationId: string;
|
|
8
7
|
query: string;
|
|
9
|
-
topK
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
docIds?: string[];
|
|
13
|
-
tags?: string[];
|
|
14
|
-
source?: Array<"admin" | "site" | "asset">;
|
|
15
|
-
};
|
|
8
|
+
topK: number;
|
|
9
|
+
siteId?: string;
|
|
10
|
+
correlationId: string;
|
|
16
11
|
createdAt: string;
|
|
17
12
|
};
|
|
18
13
|
}
|
|
@@ -4,17 +4,17 @@ export interface KnowledgeQueryRespondedEvent {
|
|
|
4
4
|
data: {
|
|
5
5
|
threadId: string;
|
|
6
6
|
userId: string;
|
|
7
|
-
correlationId: string;
|
|
8
7
|
query: string;
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
topK: number;
|
|
9
|
+
matches: Array<{
|
|
10
|
+
documentId: string;
|
|
11
11
|
chunkId: string;
|
|
12
12
|
score: number;
|
|
13
13
|
text: string;
|
|
14
14
|
title?: string;
|
|
15
|
-
url?: string;
|
|
16
15
|
siteId?: string;
|
|
17
16
|
}>;
|
|
17
|
+
correlationId: string;
|
|
18
18
|
createdAt: string;
|
|
19
19
|
};
|
|
20
20
|
}
|
package/package.json
CHANGED
|
@@ -3,11 +3,10 @@ import { Subjects } from "../subjects";
|
|
|
3
3
|
export interface KnowledgeDocumentIndexedEvent {
|
|
4
4
|
subject: Subjects.KnowledgeDocumentIndexed;
|
|
5
5
|
data: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
chunksIndexed?: number;
|
|
10
|
-
error?: string; // only if failed
|
|
6
|
+
documentId: string;
|
|
7
|
+
siteId?: string;
|
|
8
|
+
chunks: number;
|
|
11
9
|
indexedAt: string;
|
|
10
|
+
correlationId: string;
|
|
12
11
|
};
|
|
13
12
|
}
|
|
@@ -3,14 +3,19 @@ import { Subjects } from "../subjects";
|
|
|
3
3
|
export interface KnowledgeDocumentUpsertedEvent {
|
|
4
4
|
subject: Subjects.KnowledgeDocumentUpserted;
|
|
5
5
|
data: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
documentId: string;
|
|
7
|
+
// optional scoping (helps future filters)
|
|
8
|
+
siteId?: string;
|
|
9
|
+
title: string;
|
|
10
|
+
language?: string; // optional
|
|
11
|
+
// if you store raw text in mongo, no need to ship whole text in event
|
|
12
|
+
// BUT for MVP, you *can* include it to avoid another DB lookup:
|
|
9
13
|
text: string;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
|
|
15
|
+
// who created it (admin)
|
|
16
|
+
createdByUserId: string;
|
|
17
|
+
|
|
18
|
+
createdAt: string;
|
|
19
|
+
correlationId: string;
|
|
15
20
|
};
|
|
16
21
|
}
|
|
@@ -5,15 +5,14 @@ export interface KnowledgeQueryRequestedEvent {
|
|
|
5
5
|
data: {
|
|
6
6
|
threadId: string;
|
|
7
7
|
userId: string;
|
|
8
|
+
|
|
9
|
+
query: string;
|
|
10
|
+
topK: number;
|
|
11
|
+
|
|
12
|
+
// optional filters
|
|
13
|
+
siteId?: string;
|
|
14
|
+
|
|
8
15
|
correlationId: string;
|
|
9
|
-
query: string; // user prompt (or a refined query)
|
|
10
|
-
topK?: number; // default 5-10
|
|
11
|
-
filters?: {
|
|
12
|
-
siteId?: string;
|
|
13
|
-
docIds?: string[];
|
|
14
|
-
tags?: string[];
|
|
15
|
-
source?: Array<"admin" | "site" | "asset">;
|
|
16
|
-
};
|
|
17
16
|
createdAt: string;
|
|
18
17
|
};
|
|
19
18
|
}
|
|
@@ -5,17 +5,21 @@ export interface KnowledgeQueryRespondedEvent {
|
|
|
5
5
|
data: {
|
|
6
6
|
threadId: string;
|
|
7
7
|
userId: string;
|
|
8
|
-
|
|
9
|
-
query: string;
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
|
|
9
|
+
query: string;
|
|
10
|
+
topK: number;
|
|
11
|
+
|
|
12
|
+
// what you got back
|
|
13
|
+
matches: Array<{
|
|
14
|
+
documentId: string;
|
|
12
15
|
chunkId: string;
|
|
13
16
|
score: number;
|
|
14
|
-
text: string;
|
|
17
|
+
text: string;
|
|
15
18
|
title?: string;
|
|
16
|
-
url?: string;
|
|
17
19
|
siteId?: string;
|
|
18
20
|
}>;
|
|
21
|
+
|
|
22
|
+
correlationId: string;
|
|
19
23
|
createdAt: string;
|
|
20
24
|
};
|
|
21
25
|
}
|