Documentation
¶
Index ¶
- Constants
- func QuoteIn(quote, text string) bool
- func Verify(claim string, claimStep model.Step, d *store.SessionData) bool
- type Analyzer
- type Citations
- type Input
- type Output
- type Pack
- func (p *Pack) ClaimSteps(hunkID string, n int) map[string]bool
- func (p *Pack) ContextSteps(hunkID string, before int) []string
- func (p *Pack) HunkBlock(id string, withPatch bool) string
- func (p *Pack) HunkID(alias string) string
- func (p *Pack) IntentBlock() string
- func (p *Pack) IntentID(alias string) string
- func (p *Pack) SetIntent(items []model.IntentItem)
- func (p *Pack) Step(id string) (model.Step, bool)
- func (p *Pack) StepBlock(id string, summary bool) string
- func (p *Pack) StepID(alias string) string
- func (p *Pack) Steps() []model.Step
Constants ¶
const NoEvidence = "No evidence-backed explanation."
const NotInRecord = "Not in the session record."
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Analyzer ¶
type Citations ¶
func Validate ¶
func Validate(text string, stepID, hunkID func(string) string, keepNotInRecord bool) (string, Citations)
Validate keeps only sentences with at least one valid citation, removes invalid citations, and maps alias IDs to real IDs. The map functions return "" for an unknown alias. A sentence that says the answer is not in the record is kept without a citation when keepNotInRecord is true.
type Input ¶
type Input struct {
Change model.Change
Hunks []model.Hunk
Provenance map[string][]model.HunkProvenance
Sessions []*store.SessionData
Units []model.ReviewUnit
}
type Output ¶
type Output struct {
Intent []model.IntentItem
Units []model.ReviewUnit
HunkUnit map[string]string
GroupingFallback bool
Rationales []model.Rationale
HunkIntent []model.HunkIntent
StepSummaries map[string]string
Model string
Warnings []string
}
type Pack ¶
Pack renders the session as delimited blocks with short aliases (s1, h1, i1) and maps the aliases back to real IDs. Every rendered string passes through the redactor again before it can reach a provider.
func (*Pack) ClaimSteps ¶
ClaimSteps returns the agent text steps that may hold a claim about a hunk: assistant, reasoning and plan steps of the same agent actor among each provenance step and the n steps before it. Human edits have none.
func (*Pack) ContextSteps ¶
ContextSteps returns the provenance steps of a hunk and the 3 steps before each of them, in order.
func (*Pack) IntentBlock ¶
func (*Pack) SetIntent ¶
func (p *Pack) SetIntent(items []model.IntentItem)