config

package
v0.4.14-rc.8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BlueprintContext []byte
View Source
var BlueprintDefault []byte
View Source
var Blueprints = map[string][]byte{
	"default": BlueprintDefault,
	"context": BlueprintContext,
}

Functions

func GetBlueprint added in v0.4.9

func GetBlueprint(name string) ([]byte, error)

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 FromBlueprint added in v0.4.9

func FromBlueprint(name string) (*FlowConfig, error)

func FromBytes added in v0.4.9

func FromBytes(content []byte) (*FlowConfig, error)

func FromFile

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

FromFile reads a configuration file and returns a FlowConfig.

func Load added in v0.4.9

func Load(reference string) (*FlowConfig, error)

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"`
	Globals   FlowConfigEntryGlobalOpts `json:"globals,omitempty" yaml:"globals" mapstructure:"globals"`
	Ingestion []IngestionFlowConfig     `json:"ingestion,omitempty" yaml:"ingestion" mapstructure:"ingestion"`
	Retrieval *RetrievalFlowConfig      `json:"retrieval,omitempty" yaml:"retrieval" mapstructure:"retrieval"`
}

type FlowConfigEntryGlobalOpts added in v0.4.8

type FlowConfigEntryGlobalOpts struct {
	Ingestion FlowConfigGlobalsIngestion `json:"ingestion,omitempty" yaml:"ingestion" mapstructure:"ingestion"`
}

type FlowConfigGlobalsIngestion added in v0.4.8

type FlowConfigGlobalsIngestion struct {
	Textsplitter map[string]any `json:"textsplitter,omitempty" yaml:"textsplitter" mapstructure:"textsplitter"`
}

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(globals *FlowConfigGlobalsIngestion) (*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