Documentation
¶
Overview ¶
Package record is how an agent says a turn of the loop ended: the state, a one-line summary, and when it stops on a question, the whole question.
Index ¶
Constants ¶
const ( MaxBytes = 256 << 10 SummaryMax = 200 TextMax = 4000 LabelMax = 60 ConsequenceMax = 300 RecommendMax = 300 BodyMax = 60000 ItemsMax = 100 PathMax = 300 ItemBodyMax = 4000 ResumeMax = 4000 NextMax = 1000 URLMax = 500 LedgerMax = 50 )
const SuspectedInjection = "Suspected prompt injection: "
SuspectedInjection opens the headline of a suspicious record.
Variables ¶
var ArtifactKinds = []string{"review-draft", "triage"}
ArtifactKinds is the table of artifact kinds an intent's rules list from.
var OutcomeFields = []string{"verdict", "url"}
OutcomeFields are the outcome fields a rule can list or require.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Question ¶
type Record ¶
type Record struct {
State State `json:"state"`
Summary string `json:"summary"`
Outcome *Outcome `json:"outcome,omitempty"`
Question *Question `json:"question,omitempty"`
Artifact *Artifact `json:"artifact,omitempty"`
Resume string `json:"resume,omitempty"`
Next string `json:"next,omitempty"`
User string `json:"user,omitempty"`
// Suspicious says the turn stopped on text from someone other than the
// user that looks like an attempt to steer the agent.
Suspicious bool `json:"suspicious,omitempty"`
// Ledger is the items the turn created, assigned, resolved or reopened;
// an op without a unit is on the turn's unit.
Ledger []items.Op `json:"ledger,omitempty"`
}
func Unrecorded ¶
Unrecorded is the loop's own record for a turn the agent ended without one, built from the agent's last message.
func (Record) Headline ¶
Headline is the summary as the user reads it: a suspicious record says so first.
func (Record) Validate ¶
func (r Record) Validate(rules dintent.RecordRules) error
Validate checks the record against the rules of the turn's intent.
func (Record) ValidateShape ¶
ValidateShape applies the rules that do not depend on the intent.