config

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SensitiveFields = []string{
	"password",
	"apikey",
	"token",
	"secret",
	"credentials",
	"auth",
}

Functions

func RedactSensitive added in v0.1.8

func RedactSensitive(s any, fields ...string) any

Types

type DocumentLoaderConfig

type DocumentLoaderConfig struct {
	GenericBaseConfig
}

type FlowConfig

type FlowConfig struct {
	Flows    map[string]FlowConfigEntry `json:"flows" yaml:"flows" mapstructure:"flows"`
	Datasets map[string]string          `json:"datasets,omitempty" yaml:"datasets" mapstructure:"datasets"`
}

func FromFile

func FromFile(filename string) (*FlowConfig, error)

FromFile reads a configuration file and returns a FlowConfig.

func (*FlowConfig) ForDataset

func (f *FlowConfig) ForDataset(name string) (*FlowConfigEntry, error)

func (*FlowConfig) GetDefaultFlowConfigEntry

func (f *FlowConfig) GetDefaultFlowConfigEntry() (*FlowConfigEntry, error)

func (*FlowConfig) GetFlow

func (f *FlowConfig) GetFlow(name string) (*FlowConfigEntry, error)

func (*FlowConfig) Validate

func (f *FlowConfig) Validate() error

type FlowConfigEntry

type FlowConfigEntry struct {
	Default   bool                  `json:"default,omitempty" yaml:"default" mapstructure:"default"`
	Ingestion []IngestionFlowConfig `json:"ingestion,omitempty" yaml:"ingestion" mapstructure:"ingestion"`
	Retrieval *RetrievalFlowConfig  `json:"retrieval,omitempty" yaml:"retrieval" mapstructure:"retrieval"`
}

type GenericBaseConfig

type GenericBaseConfig struct {
	Name    string         `json:"name" yaml:"name" mapstructure:"name"`
	Options map[string]any `json:"options,omitempty" yaml:"options" mapstructure:"options"`
}

type IngestionFlowConfig

type IngestionFlowConfig struct {
	Filetypes      []string             `json:"filetypes" yaml:"filetypes" mapstructure:"filetypes"`
	DocumentLoader DocumentLoaderConfig `json:"documentLoader,omitempty" yaml:"documentLoader" mapstructure:"documentLoader"`
	TextSplitter   TextSplitterConfig   `json:"textSplitter,omitempty" yaml:"textSplitter" mapstructure:"textSplitter"`
	Transformers   []TransformerConfig  `json:"transformers,omitempty" yaml:"transformers" mapstructure:"transformers"`
}

func (*IngestionFlowConfig) AsIngestionFlow

func (i *IngestionFlowConfig) AsIngestionFlow() (*flows.IngestionFlow, error)

AsIngestionFlow converts an IngestionFlowConfig to an actual flows.IngestionFlow.

type QueryModifierConfig

type QueryModifierConfig struct {
	GenericBaseConfig
}

type RetrievalFlowConfig

type RetrievalFlowConfig struct {
	// QueryModifiers allows to modify the input query before it is passed to the retriever. (Query-Rewriting)
	QueryModifiers []QueryModifierConfig `json:"queryModifiers,omitempty" yaml:"queryModifiers" mapstructure:"queryModifiers"`

	// Retriever is the configuration for the retriever to be used. E.g. instead of using a naive retriever, you can use a recursive or refining retriever.
	Retriever *RetrieverConfig `json:"retriever,omitempty" yaml:"retriever" mapstructure:"retriever"`

	// Postprocessors are used to process the retrieved documents before they are returned. This may include stripping metadata or re-ranking.
	Postprocessors []TransformerConfig `json:"postprocessors,omitempty" yaml:"postprocessors" mapstructure:"postprocessors"`
}

func (*RetrievalFlowConfig) AsRetrievalFlow

func (r *RetrievalFlowConfig) AsRetrievalFlow() (*flows.RetrievalFlow, error)

type RetrieverConfig

type RetrieverConfig struct {
	GenericBaseConfig
}

type TextSplitterConfig

type TextSplitterConfig struct {
	GenericBaseConfig
}

type TransformerConfig

type TransformerConfig struct {
	GenericBaseConfig
}

Jump to

Keyboard shortcuts

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