Changeset 0.19.0.1 (#82)
This commit is contained in:
@@ -851,6 +851,25 @@ func BuildKBHint(ctx context.Context, stores store.Stores, channelID, userID, pe
|
||||
}
|
||||
}
|
||||
|
||||
// Project-bound KBs (v0.19.0)
|
||||
if stores.Projects != nil {
|
||||
projID, _ := stores.Projects.GetProjectIDForChannel(ctx, channelID)
|
||||
if projID != "" {
|
||||
projKBIDs, projErr := stores.Projects.GetKBIDs(ctx, projID)
|
||||
if projErr == nil {
|
||||
for _, kbID := range projKBIDs {
|
||||
if !seen[kbID] {
|
||||
kb, kbErr := stores.KnowledgeBases.GetByID(ctx, kbID)
|
||||
if kbErr == nil && kb.ChunkCount > 0 {
|
||||
kbs = append(kbs, kbInfo{Name: kb.Name, DocCount: kb.DocumentCount})
|
||||
seen[kbID] = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Channel-linked KBs
|
||||
channelKBs, err := stores.KnowledgeBases.GetChannelKBs(ctx, channelID)
|
||||
if err == nil {
|
||||
|
||||
Reference in New Issue
Block a user