[Observability AI Assistant] [KB] Allow documents to not have labels (#176194)

This commit is contained in:
Coen Warmer 2024-02-04 20:44:08 +01:00 committed by GitHub
parent 099e2d4cf8
commit b774cc6606
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -16,7 +16,7 @@ export interface KnowledgeBaseEntryCategory {
export function categorizeEntries({ entries }: { entries: KnowledgeBaseEntry[] }) {
return entries.reduce((acc, entry) => {
const categoryName = entry.labels.category ?? entry.id;
const categoryName = entry.labels?.category ?? entry.id;
const index = acc.findIndex((item) => item.categoryName === categoryName);

View file

@ -86,7 +86,7 @@ export interface KnowledgeBaseEntry {
confidence: 'low' | 'medium' | 'high';
is_correction: boolean;
public: boolean;
labels: Record<string, string>;
labels?: Record<string, string>;
role: KnowledgeBaseEntryRole;
}