Documentation
¶
Overview ¶
Package recommend supplies detail-page related rows. Home and section composition, taste models and caches live in internal/personalize.
Index ¶
- func FilterTitles(titles []core.Title, user *core.User) []core.Title
- type EventSource
- type LLMSource
- type Options
- type Recommender
- func (r *Recommender) Close()
- func (r *Recommender) HomeHubs(ctx context.Context, u *core.User, limit int) ([]core.Hub, error)
- func (r *Recommender) Related(ctx context.Context, user *core.User, key core.RatingKey, limit int) ([]core.Hub, error)
- func (r *Recommender) SectionHubs(ctx context.Context, u *core.User, typ core.MediaType, limit int) ([]core.Hub, error)
- func (r *Recommender) SetHomeSource(home core.Recommender)
- func (r *Recommender) SetScorer(s core.PersonalScorer)
- type TraktHistorySource
- type TraktSource
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EventSource ¶
EventSource invalidates the model cache on watch-state changes (internal/state.State).
type LLMSource ¶
type LLMSource interface {
ThemedRows(ctx context.Context, user *core.User, seeds []core.Title, limit int) ([]core.Hub, error)
MoreLikeThis(ctx context.Context, title *core.Title, limit int) ([]core.Title, error)
}
LLMSource is the optional LLM dependency (internal/llm.Service). ThemedRows must be non-blocking (serve stale/omit while computing).
type Options ¶
type Options struct {
Catalog core.Catalog
State core.State
LLM LLMSource
Logger *slog.Logger
SourceTimeout time.Duration
Scorer core.PersonalScorer
}
Options supplies only the dependencies used by related recommendations.
type Recommender ¶
type Recommender struct {
// contains filtered or unexported fields
}
func New ¶
func New(o Options) *Recommender
func (*Recommender) Close ¶
func (r *Recommender) Close()
Close is retained for callers which previously managed a model subscription.
func (*Recommender) SectionHubs ¶
func (*Recommender) SetHomeSource ¶
func (r *Recommender) SetHomeSource(home core.Recommender)
SetHomeSource preserves the core.Recommender contract using the one production Home engine. It does not maintain another model, cache, or event subscription.
func (*Recommender) SetScorer ¶
func (r *Recommender) SetScorer(s core.PersonalScorer)
type TraktHistorySource ¶
type TraktHistorySource interface {
PullHistory(ctx context.Context, userID int64, limit int) ([]core.HistoryEntry, error)
}
TraktHistorySource is optionally implemented by the TraktSource (internal/trakt.Client does): plays recorded on Trakt from other apps are merged into the local history model as completions.
type TraktSource ¶
type TraktSource interface {
Recommendations(ctx context.Context, userID int64, limit int) ([]core.Title, error)
Watchlist(ctx context.Context, userID int64, limit int) ([]core.Title, error)
}
TraktSource is the optional Trakt dependency (internal/trakt.Client). Implementations return (nil, nil) for users who have not connected.