Documentation
¶
Index ¶
- Constants
- func ResolvePath(cfg config.Config, path string) (string, error)
- type ArtifactContents
- type ChatContinuity
- type PruneResult
- type Recorder
- func (r *Recorder) Event(name string, data map[string]interface{})
- func (r *Recorder) PlannerInput(input string)
- func (r *Recorder) PlannerOutput(output string)
- func (r *Recorder) SetChatContinuity(continuity *ChatContinuity)
- func (r *Recorder) SetClock(now func() time.Time)
- func (r *Recorder) SetFailure(stage string, code string, err error)
- func (r *Recorder) SetPack(pack brainresearch.Pack)
- func (r *Recorder) SetPreparedSynthesis(prepared brainresearch.PreparedSynthesis)
- func (r *Recorder) SetStopReason(reason string)
- func (r *Recorder) SetSynthesis(result brainresearch.SynthesisResult)
- func (r *Recorder) Snapshot() (ResearchTrace, ArtifactContents)
- type ResearchTrace
- type ResearchTraceEvent
- type RetentionOptions
- type TraceArtifacts
- type TraceFailure
- type TraceMetrics
- type TraceSummary
- type WriteOptions
- type WriteResult
Constants ¶
View Source
const ( SchemaVersion = "research_trace.v1" CompleteMarker = ".complete" DefaultKeepRuns = 500 DefaultMaxAge = 180 * 24 * time.Hour )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ArtifactContents ¶
type ChatContinuity ¶
type ChatContinuity struct {
OriginalQuestion string `json:"original_question,omitempty"`
RetrievalQuestion string `json:"retrieval_question,omitempty"`
PriorQuestionIDs []string `json:"prior_question_ids,omitempty"`
PinnedEvidenceKeys []string `json:"pinned_evidence_keys,omitempty"`
MergedPriorEvidence []string `json:"merged_prior_evidence,omitempty"`
}
type PruneResult ¶
func Prune ¶
func Prune(cfg config.Config, opts RetentionOptions, activeRunID string) (PruneResult, error)
type Recorder ¶
type Recorder struct {
// contains filtered or unexported fields
}
func NewRecorder ¶
func (*Recorder) PlannerInput ¶
func (*Recorder) PlannerOutput ¶
func (*Recorder) SetChatContinuity ¶
func (r *Recorder) SetChatContinuity(continuity *ChatContinuity)
func (*Recorder) SetPack ¶
func (r *Recorder) SetPack(pack brainresearch.Pack)
func (*Recorder) SetPreparedSynthesis ¶
func (r *Recorder) SetPreparedSynthesis(prepared brainresearch.PreparedSynthesis)
func (*Recorder) SetStopReason ¶
func (*Recorder) SetSynthesis ¶
func (r *Recorder) SetSynthesis(result brainresearch.SynthesisResult)
func (*Recorder) Snapshot ¶
func (r *Recorder) Snapshot() (ResearchTrace, ArtifactContents)
type ResearchTrace ¶
type ResearchTrace struct {
SchemaVersion string `json:"schema_version"`
RunID string `json:"run_id"`
Surface string `json:"surface"`
Question string `json:"question"`
ChatContinuity *ChatContinuity `json:"chat_continuity,omitempty"`
StartedAt time.Time `json:"started_at"`
CompletedAt time.Time `json:"completed_at"`
Events []ResearchTraceEvent `json:"events,omitempty"`
Metrics TraceMetrics `json:"metrics"`
Pack *brainresearch.Pack `json:"pack,omitempty"`
PreparedSynthesis *brainresearch.PreparedSynthesis `json:"prepared_synthesis,omitempty"`
Synthesis *brainresearch.SynthesisResult `json:"synthesis,omitempty"`
Artifacts TraceArtifacts `json:"artifacts,omitempty"`
StopReason string `json:"stop_reason"`
Failure *TraceFailure `json:"failure,omitempty"`
}
func Decode ¶
func Decode(data []byte) (ResearchTrace, error)
type ResearchTraceEvent ¶
type RetentionOptions ¶
type TraceArtifacts ¶
type TraceFailure ¶
type TraceMetrics ¶
type TraceMetrics struct {
TotalDurationMS int64 `json:"total_duration_ms,omitempty"`
StageDurationsMS map[string]int64 `json:"stage_durations_ms,omitempty"`
QueryVariantCount int `json:"query_variant_count,omitempty"`
CandidateCountBeforeDedupe int `json:"candidate_count_before_dedupe,omitempty"`
EvidenceCountAfterDedupe int `json:"evidence_count_after_dedupe,omitempty"`
ModelCallCount int `json:"model_call_count,omitempty"`
CharactersSentToPlanner int `json:"characters_sent_to_planner,omitempty"`
CharactersSentToSynthesis int `json:"characters_sent_to_synthesis,omitempty"`
TraceArtifactBytes int64 `json:"trace_artifact_bytes,omitempty"`
PlannerEnabled bool `json:"planner_enabled"`
Planner string `json:"planner,omitempty"`
PlannerFallbackStatus string `json:"planner_fallback_status,omitempty"`
}
type TraceSummary ¶
type TraceSummary struct {
RunID string `json:"run_id"`
RelativePath string `json:"relative_path"`
Surface string `json:"surface,omitempty"`
Question string `json:"question,omitempty"`
CompletedAt time.Time `json:"completed_at,omitempty"`
StopReason string `json:"stop_reason,omitempty"`
EvidenceCount int `json:"evidence_count,omitempty"`
AnswerStatus string `json:"answer_status,omitempty"`
LoadError string `json:"load_error,omitempty"`
}
type WriteOptions ¶
type WriteOptions struct {
Retention RetentionOptions
Now func() time.Time
}
type WriteResult ¶
func Write ¶
func Write(cfg config.Config, trace ResearchTrace, artifacts ArtifactContents, opts WriteOptions) (WriteResult, error)
Click to show internal directories.
Click to hide internal directories.