ui

package
v0.4.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StaticFS embed.FS

Functions

func GetFuncMap

func GetFuncMap() template.FuncMap

Types

type ContextStats

type ContextStats struct {
	SystemPromptPct float64
	UserFactsPct    float64
	EnvFactsPct     float64
	RAGContextPct   float64
	HistoryPct      float64
	TotalSize       int
}

type PageData

type PageData struct {
	Users          []storage.User
	SelectedUserID int64
	Data           interface{}
}

PageData holds the common data required for rendering pages.

type RAGLogView

type RAGLogView struct {
	storage.RAGLog
	ParsedContext []openrouter.Message
	ParsedResults interface{}

	// New fields
	SystemPromptPart string
	UserFactsPart    string
	EnvFactsPart     string
	RAGContextPart   string
	LastMessages     []openrouter.Message
	ToolCalls        []openrouter.Message
	Stats            ContextStats
}

func ParseRAGLog

func ParseRAGLog(l storage.RAGLog) RAGLogView

type Renderer

type Renderer struct {
	// contains filtered or unexported fields
}

func NewRenderer

func NewRenderer() (*Renderer, error)

func (*Renderer) Render

func (r *Renderer) Render(w io.Writer, pageTemplateFile string, data interface{}, funcMap template.FuncMap) error

type RerankerCandidateView added in v0.4.1

type RerankerCandidateView struct {
	TopicID      int64
	Summary      string
	Score        float32
	Date         string
	MessageCount int
	SizeChars    int
	Selected     bool
	Reason       string // Reason for selection (from reranker response)
}

RerankerCandidateView is a single candidate for template display

type RerankerLogView added in v0.4.1

type RerankerLogView struct {
	storage.RerankerLog
	Candidates     []RerankerCandidateView
	ToolCalls      []RerankerToolCallView
	SelectedIDs    map[int64]bool // For quick lookup in template
	SelectedIDList []int64
	SelectedTopics []RerankerTopicSelectionView // Full topic selection with reason/excerpt
	Reasoning      []RerankerReasoningEntry     // Reasoning entries per iteration
}

RerankerLogView is the parsed view of a RerankerLog for templates

func ParseRerankerLog added in v0.4.1

func ParseRerankerLog(l storage.RerankerLog) RerankerLogView

ParseRerankerLog parses a RerankerLog into a view struct for templates

type RerankerReasoningEntry added in v0.4.5

type RerankerReasoningEntry struct {
	Iteration int    `json:"iteration"`
	Text      string `json:"text"`
}

RerankerReasoningEntry holds reasoning text for one iteration (matches rag.RerankerReasoningEntry)

type RerankerToolCallTopicView added in v0.4.1

type RerankerToolCallTopicView struct {
	ID      int64
	Summary string
}

RerankerToolCallTopicView contains topic info for tool call display

type RerankerToolCallView added in v0.4.1

type RerankerToolCallView struct {
	Iteration int
	Topics    []RerankerToolCallTopicView
}

RerankerToolCallView represents one iteration of tool calls for template display

type RerankerTopicSelectionView added in v0.4.3

type RerankerTopicSelectionView struct {
	ID         int64
	Reason     string
	Excerpt    string // Empty string if none
	SizeChars  int    // Original topic size in chars
	ExcerptLen int    // Length of excerpt (0 if no excerpt)
}

RerankerTopicSelectionView represents a selected topic with reason and optional excerpt

type TopicLogView

type TopicLogView struct {
	storage.RAGLog
	ParsedTopics  []rag.ExtractedTopic
	ParseError    string
	InputMsgCount int
	InputStartID  int64
	InputEndID    int64
	ChunkDate     time.Time
}

func ParseTopicLog

func ParseTopicLog(l storage.RAGLog) TopicLogView

type TopicView

type TopicView struct {
	storage.TopicExtended
	Messages []storage.Message
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL