route

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2025 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Route
}

func (*Config) Validate

func (c *Config) Validate() error

type Dependencies

type Dependencies struct {
	RelatedScore func(a, b [][]float32) (float32, error) // MUST same with vector index.
	LLMFactory   llm.Factory
}

type Factory

--- Factory code block ---

func NewFactory

func NewFactory(mockOn ...component.MockOption) Factory

type Feed

type Feed struct {
	*model.Feed
	Related []*Feed     `json:"related"`
	Vectors [][]float32 `json:"-"`
}

type FeedGroup

type FeedGroup struct {
	Name    string
	Time    time.Time
	Labels  model.Labels
	Feeds   []*Feed
	Summary string
}

func (*FeedGroup) ID

func (g *FeedGroup) ID() string

type Group

type Group struct {
	FeedGroup
	Receivers []string
}

type Route

type Route struct {
	GroupBy                    []string
	SourceLabel                string
	SummaryPrompt              string
	LLM                        string
	CompressByRelatedThreshold *float32
	Receivers                  []string
	SubRoutes                  SubRoutes
}

type Router

type Router interface {
	component.Component
	Route(ctx context.Context, result *rule.Result) (groups []*Group, err error)
}

--- Interface code block ---

type SubRoute

type SubRoute struct {
	Route
	Matchers []string
	// contains filtered or unexported fields
}

func (*SubRoute) Match

func (r *SubRoute) Match(feed *block.FeedVO) *SubRoute

func (*SubRoute) Validate

func (r *SubRoute) Validate() error

type SubRoutes

type SubRoutes []*SubRoute

func (SubRoutes) Match

func (s SubRoutes) Match(feed *block.FeedVO) *SubRoute

Jump to

Keyboard shortcuts

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