combinators

package
v0.19.1 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: Apache-2.0, MIT Imports: 4 Imported by: 0

Documentation

Overview

Package combinators contains tools to put various retrieval components together to make full retrievers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AsyncCandidateSplitter added in v0.6.0

type AsyncCandidateSplitter[T comparable] struct {
	Keys              []T
	CandidateSplitter types.CandidateSplitter[T]
}

AsyncCandidateSplitter creates an splitter for a candidate stream from a simple function to split a set of candidates. Essentially, on each new candidate set from the stream, we run the splitter function, and feed the split candidates sets into the appropriate downstream candidate streams

func NewAsyncCandidateSplitter added in v0.6.0

func NewAsyncCandidateSplitter[T comparable](keys []T, newCandidateSplitter NewCandidateSplitterFn[T]) AsyncCandidateSplitter[T]

NewAsyncCandidateSplitter creates a new candidate splitter with the given passed in sync splitter constructor

func (AsyncCandidateSplitter[T]) SplitRetrievalRequest added in v0.6.0

func (acs AsyncCandidateSplitter[T]) SplitRetrievalRequest(ctx context.Context, request types.RetrievalRequest, events func(types.RetrievalEvent)) types.AsyncRetrievalSplitter[T]

SplitRetrievalRequest splits candidate streams for a given retrieval request

type NewCandidateSplitterFn added in v0.6.0

type NewCandidateSplitterFn[T comparable] func(keys []T) types.CandidateSplitter[T]

NewCandidateSplitterFn constructs a new candidate splitter for the given keys it's used to insurate

type RetrieverWithCandidateFinder

type RetrieverWithCandidateFinder struct {
	CandidateFinder    types.CandidateFinder
	CandidateRetriever types.CandidateRetriever
}

RetrieverWithCandidateFinder retrieves from a candidate retriever after first retrieving candidates from a candidate finder

func (RetrieverWithCandidateFinder) Retrieve

type SplitRetriever

type SplitRetriever[T comparable] struct {
	AsyncCandidateSplitter types.AsyncCandidateSplitter[T]
	CandidateRetrievers    map[T]types.CandidateRetriever
	CoordinationKind       types.CoordinationKind
}

SplitRetriever retrieves by first splitting candidates with a splitter, then passing the split sets to multiple retrievers using the given coordination style

func (SplitRetriever[T]) Retrieve

Jump to

Keyboard shortcuts

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