Changeset 0.19.0.1 (#82)
This commit is contained in:
@@ -83,6 +83,24 @@ func (t *kbSearchTool) Execute(ctx context.Context, execCtx ExecutionContext, ar
|
||||
return "", fmt.Errorf("failed to look up active knowledge bases: %w", err)
|
||||
}
|
||||
|
||||
// Also include project-bound KBs (v0.19.0)
|
||||
if t.stores.Projects != nil {
|
||||
projID, _ := t.stores.Projects.GetProjectIDForChannel(ctx, execCtx.ChannelID)
|
||||
if projID != "" {
|
||||
projKBIDs, _ := t.stores.Projects.GetKBIDs(ctx, projID)
|
||||
projSet := make(map[string]bool, len(kbIDs))
|
||||
for _, id := range kbIDs {
|
||||
projSet[id] = true
|
||||
}
|
||||
for _, id := range projKBIDs {
|
||||
if !projSet[id] {
|
||||
kbIDs = append(kbIDs, id)
|
||||
projSet[id] = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Also include personal KBs (always available to owner, even if not linked to channel)
|
||||
personalKBs, err := t.stores.KnowledgeBases.ListPersonal(ctx, execCtx.UserID)
|
||||
if err == nil {
|
||||
|
||||
Reference in New Issue
Block a user