Reuse source indexes in occurrence extraction
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
|
||||
"go.maximumdirect.net/promptkit"
|
||||
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/core/source"
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/framework/contracts"
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/framework/pipeline"
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/modules/dnd"
|
||||
@@ -92,12 +93,17 @@ func (e *Extractor) PrepareExtraction(ctx context.Context, req contracts.Extract
|
||||
if !registry.Bound() {
|
||||
return nil, extractorErrorf("location registry reference is required")
|
||||
}
|
||||
grounding, err := locationregistry.NewGrounding(registry, req.Source)
|
||||
index := req.SourceIndex
|
||||
if index == nil {
|
||||
local := source.NewDocumentIndex(req.Source)
|
||||
index = &local
|
||||
}
|
||||
grounding, err := locationregistry.NewGroundingForSource(registry, req.Source, index)
|
||||
if err != nil {
|
||||
return nil, extractorErrorf("prepare location grounding: %w", err)
|
||||
}
|
||||
|
||||
order := shared.NewSourceRefOrder(req.Source)
|
||||
order := shared.NewSourceRefOrderForSource(req.Source, index)
|
||||
|
||||
sourceID := req.Source.ID
|
||||
materials := shared.PromptInputs(sourceInput, req.References)
|
||||
|
||||
Reference in New Issue
Block a user