MCPcopy Create free account
hub / github.com/astercloud/aster / BulkAdd

Method BulkAdd

pkg/knowledge/manager.go:661–673  ·  view source on GitHub ↗

BulkAdd 批量添加知识

(ctx context.Context, items []*KnowledgeItem)

Source from the content-addressed store, hash-verified

659
660// BulkAdd 批量添加知识
661func (m *manager) BulkAdd(ctx context.Context, items []*KnowledgeItem) error {
662 if len(items) == 0 {
663 return nil
664 }
665
666 for _, item := range items {
667 if err := m.Add(ctx, item); err != nil {
668 return fmt.Errorf("knowledge: bulk add failed for item %s: %w", item.ID, err)
669 }
670 }
671
672 return nil
673}
674
675// BulkSearch 批量搜索
676func (m *manager) BulkSearch(ctx context.Context, queries []*SearchQuery) ([][]*SearchResult, error) {

Callers

nothing calls this directly

Calls 1

AddMethod · 0.95

Tested by

no test coverage detected