sourceenrich

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: MIT Imports: 35 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

View Source
const SummaryPromptVersion = "dbrain-v1"

Variables

This section is empty.

Functions

func MaybeTranscribeYouTubeAudioFallback

func MaybeTranscribeYouTubeAudioFallback(ctx context.Context, cfg config.Config, source model.SourceDocument, extract model.ExtractResult, opts Options) (model.ExtractResult, bool, error)

func SummarizeSourceReadOnly added in v0.1.5

func SummarizeSourceReadOnly(ctx context.Context, cfg config.Config, source model.SourceDocument, opts Options) (model.SummaryResult, error)

SummarizeSourceReadOnly runs the normal source-summary prompt against an already extracted source without saving any derived state.

Types

type Options

type Options struct {
	Limit                 int
	Concurrency           int
	Force                 bool
	AcceptCurrentSummary  bool
	Summarize             bool
	Model                 string
	CLI                   string
	Length                string
	Language              string
	Timeout               time.Duration
	ProgressInterval      time.Duration
	Logger                *slog.Logger
	ExactSummaryFreshness bool
	Metrics               metrics.RunContext
	// InferenceParams carries optional provider-specific sampler parameters
	// for parity-aware bakeoff runs. Normal source-summary callers leave
	// this empty so provider/runtime defaults apply.
	InferenceParams           llmprovider.ParityParams
	EnvFor                    func(source model.SourceDocument) map[string]string
	ArgsFor                   func(source model.SourceDocument) []string
	ResolveHost               func(ctx context.Context, host string) error
	ResolveRedirectURL        func(ctx context.Context, rawURL string) (string, error)
	FallbackExtractFor        func(ctx context.Context, source model.SourceDocument, extract model.ExtractResult) (model.ExtractResult, bool, error)
	HTTPReaderFallbackDomains []string
	HTTPReaderBaseURL         string
	WaybackFallbackEnabled    bool
	WaybackAvailabilityURL    string
	Binary                    string
	YouTubeBrowser            string
	YouTubeProfile            string
	YouTubeCookiesArg         string
	YouTubeTranscriber        string
	YTDLPBinary               string
	WhisperBinary             string
	WhisperModelPath          string
	MacWhisperBinary          string
	// OnSourceResult is called when a source enrichment candidate completes.
	// Callers must treat it as concurrent when Concurrency > 1.
	OnSourceResult func(SourceResult)
}

type SourceResult added in v0.2.26

type SourceResult struct {
	SourceID           int64
	SourceKey          string
	Duration           time.Duration
	Error              string
	Extracted          bool
	SummaryCreated     bool
	SummaryStatus      string
	SummaryModel       string
	SummaryProvider    string
	SummaryAPIModel    string
	SummaryTransport   string
	SummaryTool        string
	SummaryToolVersion string
	SummaryChars       int
}

type Stats

type Stats struct {
	SourcesQueued     int `json:"sources_queued"`
	SourcesExtracted  int `json:"sources_extracted"`
	SourcesSummarized int `json:"sources_summarized"`
	SourcesRendered   int `json:"sources_rendered"`
	SourcesUnchanged  int `json:"sources_unchanged"`
	Errors            int `json:"errors"`
}

func RunPending

func RunPending(ctx context.Context, cfg config.Config, st *store.Store, opts Options) (Stats, []int64, error)

func RunSourceIDs

func RunSourceIDs(ctx context.Context, cfg config.Config, st *store.Store, sourceIDs []int64, opts Options) (Stats, []int64, error)

Jump to

Keyboard shortcuts

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