retrieval

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: May 10, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendUniqueContentSection

func AppendUniqueContentSection(sections *[]ContentSection, section ContentSection)

func FirstNonZeroTime

func FirstNonZeroTime(values ...time.Time) time.Time

func FormatTime

func FormatTime(value time.Time) string

func ItemMetadata

func ItemMetadata(item model.Item) map[string]interface{}

func SourceMetadata

func SourceMetadata(source model.SourceDocument) map[string]interface{}

func TruncateText

func TruncateText(value string, maxChars int) (string, bool)

Types

type ContentSection

type ContentSection struct {
	Name      string `json:"name"`
	Role      string `json:"role"`
	Status    string `json:"status,omitempty"`
	Model     string `json:"model,omitempty"`
	Tool      string `json:"tool,omitempty"`
	At        string `json:"at,omitempty"`
	Chars     int    `json:"chars"`
	Text      string `json:"text,omitempty"`
	Truncated bool   `json:"truncated"`
}

func ContentSectionCatalog

func ContentSectionCatalog(sections []ContentSection) []ContentSection

func NewContentSection

func NewContentSection(name, role, status, modelName, tool string, at time.Time, text string, maxChars int) ContentSection

type EvidenceDocument

type EvidenceDocument struct {
	SourceKey     string         `json:"source_key"`
	Kind          string         `json:"kind"`
	Title         string         `json:"title"`
	URL           string         `json:"url"`
	NotePath      string         `json:"note_path"`
	Summary       string         `json:"summary"`
	Excerpt       string         `json:"excerpt"`
	Author        string         `json:"author,omitempty"`
	SourceType    string         `json:"source_type,omitempty"`
	PublishedAt   string         `json:"published_at,omitempty"`
	ExtractedAt   string         `json:"extracted_at,omitempty"`
	SummarizedAt  string         `json:"summarized_at,omitempty"`
	UserTags      string         `json:"user_tags,omitempty"`
	EntityMatches []string       `json:"entity_matches,omitempty"`
	RelatedTo     string         `json:"related_to,omitempty"`
	Relationship  string         `json:"relationship,omitempty"`
	Retrieval     *RetrievalInfo `json:"retrieval,omitempty"`
}

type QueryWindowOptions

type QueryWindowOptions struct {
	MaxChars        int
	LeadDivisor     int
	EllipsisReserve int
	CountText       string
	TermCounts      map[string]int
}

type QueryWindowResult

type QueryWindowResult struct {
	Text      string
	Score     int
	Matched   bool
	Truncated bool
}

func QueryWindow

func QueryWindow(value string, candidates []string, coverageTerms []string, opts QueryWindowOptions) QueryWindowResult

type RelatedDocument

type RelatedDocument struct {
	ID                     int64  `json:"id"`
	SourceKey              string `json:"source_key"`
	SourceType             string `json:"source_type"`
	ExternalID             string `json:"external_id"`
	CanonicalURL           string `json:"canonical_url"`
	Title                  string `json:"title"`
	AuthorHandle           string `json:"author_handle"`
	AuthorName             string `json:"author_name"`
	PublishedAt            string `json:"published_at"`
	SavedAt                string `json:"saved_at"`
	Language               string `json:"language"`
	PrimaryCategory        string `json:"primary_category"`
	PrimaryDomain          string `json:"primary_domain"`
	NotePath               string `json:"note_path"`
	UserTags               string `json:"user_tags"`
	XPostStatus            string `json:"x_post_status"`
	SummaryStatus          string `json:"summary_status"`
	SummaryModel           string `json:"summary_model"`
	SummaryTool            string `json:"summary_tool"`
	OCRStatus              string `json:"ocr_status"`
	OCRModel               string `json:"ocr_model"`
	OCRTool                string `json:"ocr_tool"`
	XMediaTranscriptStatus string `json:"x_media_transcript_status"`
	ImportedAt             string `json:"imported_at"`
	UpdatedAt              string `json:"updated_at"`
	LastSeenAt             string `json:"last_seen_at"`
}

func RelatedDocumentFromItem

func RelatedDocumentFromItem(item model.Item) RelatedDocument

type RetrievalInfo

type RetrievalInfo struct {
	Score        int               `json:"score"`
	Signals      []RetrievalSignal `json:"signals,omitempty"`
	MatchedTerms []string          `json:"matched_terms,omitempty"`
	MissingTerms []string          `json:"missing_terms,omitempty"`
}

type RetrievalSignal

type RetrievalSignal struct {
	Name   string `json:"name"`
	Detail string `json:"detail,omitempty"`
	Weight int    `json:"weight"`
}

Jump to

Keyboard shortcuts

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