Simplify contextual entity grounding

This commit is contained in:
2026-08-08 15:47:41 +00:00
parent 20397ef710
commit d9b87347b8
6 changed files with 45 additions and 89 deletions

View File

@@ -36,7 +36,6 @@ type ContextUnit struct {
// Its prompt input contains no durable IDs or source IDs.
type Grounding struct {
promptInput contracts.LLMInputMaterial
projectionDigest string
locationsBySelector map[string]dnd.Location
}
@@ -104,7 +103,6 @@ func NewGrounding(registry *Registry, doc *source.SourceDocument) (*Grounding, e
digest := semanticDigest(content)
return &Grounding{
promptInput: contracts.NewLLMInputMaterial(ReferenceSlot, locationcodec.MediaType, content, digest, ""),
projectionDigest: digest,
locationsBySelector: locationsBySelector,
}, nil
}
@@ -118,14 +116,6 @@ func (g *Grounding) PromptInput() contracts.LLMInputMaterial {
return g.promptInput.Clone()
}
// ProjectionDigest returns the digest of the exact contextual prompt input.
func (g *Grounding) ProjectionDigest() string {
if g == nil {
return ""
}
return g.projectionDigest
}
// Resolve maps a contextual selector to one canonical location.
func (g *Grounding) Resolve(selector Selector) (dnd.Location, bool) {
if g == nil {