Simplify contextual entity grounding
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user