Documentation
¶
Index ¶
- Variables
- type LLMBashChain
- func (c LLMBashChain) Apply(ctx context.Context, inputs []schema.ChainValues) ([]schema.ChainValues, error)
- func (c LLMBashChain) Call(ctx context.Context, inputs schema.ChainValues) (schema.ChainValues, error)
- func (c LLMBashChain) InputKeys() []string
- func (c LLMBashChain) OutputKeys() []string
- func (c LLMBashChain) Run(ctx context.Context, input any) (string, error)
- type LLMBashChainOptions
- type LLMChain
- func (c LLMChain) Apply(ctx context.Context, inputs []schema.ChainValues) ([]schema.ChainValues, error)
- func (c LLMChain) Call(ctx context.Context, inputs schema.ChainValues) (schema.ChainValues, error)
- func (c LLMChain) InputKeys() []string
- func (c LLMChain) OutputKeys() []string
- func (c *LLMChain) Predict(ctx context.Context, values schema.ChainValues) (string, error)
- func (c *LLMChain) Prompt() *prompt.Template
- func (c LLMChain) Run(ctx context.Context, input any) (string, error)
- func (c *LLMChain) Type() string
- type LLMChainOptions
- type RefineDocumentsChain
- func (c RefineDocumentsChain) Apply(ctx context.Context, inputs []schema.ChainValues) ([]schema.ChainValues, error)
- func (c RefineDocumentsChain) Call(ctx context.Context, inputs schema.ChainValues) (schema.ChainValues, error)
- func (c RefineDocumentsChain) InputKeys() []string
- func (c RefineDocumentsChain) OutputKeys() []string
- func (c RefineDocumentsChain) Run(ctx context.Context, input any) (string, error)
- type RefineDocumentsOptions
- type RefineSummarizationChainOptions
- type RetrievalQA
- func (c RetrievalQA) Apply(ctx context.Context, inputs []schema.ChainValues) ([]schema.ChainValues, error)
- func (c RetrievalQA) Call(ctx context.Context, inputs schema.ChainValues) (schema.ChainValues, error)
- func (c RetrievalQA) InputKeys() []string
- func (c RetrievalQA) OutputKeys() []string
- func (c RetrievalQA) Run(ctx context.Context, input any) (string, error)
- type RetrievalQAOptions
- type StuffDocumentsChain
- func (c StuffDocumentsChain) Apply(ctx context.Context, inputs []schema.ChainValues) ([]schema.ChainValues, error)
- func (c StuffDocumentsChain) Call(ctx context.Context, inputs schema.ChainValues) (schema.ChainValues, error)
- func (c StuffDocumentsChain) InputKeys() []string
- func (c StuffDocumentsChain) OutputKeys() []string
- func (c StuffDocumentsChain) Run(ctx context.Context, input any) (string, error)
- type StuffDocumentsOptions
- type StuffSummarizationChainOptions
- type TransformChain
- func (c TransformChain) Apply(ctx context.Context, inputs []schema.ChainValues) ([]schema.ChainValues, error)
- func (c TransformChain) Call(ctx context.Context, inputs schema.ChainValues) (schema.ChainValues, error)
- func (c TransformChain) InputKeys() []string
- func (c TransformChain) OutputKeys() []string
- func (c TransformChain) Run(ctx context.Context, input any) (string, error)
- type TransformFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoInputValues = errors.New("no input values") ErrInvalidInputValues = errors.New("invalid input values") ErrInputValuesWrongType = errors.New("input key is of wrong type") ErrMultipleInputsInRun = errors.New("run not supported in chain with more then one expected input") ErrMultipleOutputsInRun = errors.New("run not supported in chain with more then one expected output") ErrWrongOutputTypeInRun = errors.New("run not supported in chain that returns value that is not string") ErrNoOutputParser = errors.New("no output parser") )
Functions ¶
This section is empty.
Types ¶
type LLMBashChain ¶ added in v0.0.3
type LLMBashChain struct {
// contains filtered or unexported fields
}
func NewLLMBashChain ¶ added in v0.0.3
func NewLLMBashChain(llmChain *LLMChain) (*LLMBashChain, error)
func NewLLMBashChainFromLLM ¶ added in v0.0.3
func NewLLMBashChainFromLLM(llm schema.LLM) (*LLMBashChain, error)
func (LLMBashChain) Apply ¶ added in v0.0.8
func (c LLMBashChain) Apply(ctx context.Context, inputs []schema.ChainValues) ([]schema.ChainValues, error)
func (LLMBashChain) Call ¶ added in v0.0.3
func (c LLMBashChain) Call(ctx context.Context, inputs schema.ChainValues) (schema.ChainValues, error)
func (LLMBashChain) InputKeys ¶ added in v0.0.3
func (c LLMBashChain) InputKeys() []string
InputKeys returns the expected input keys.
func (LLMBashChain) OutputKeys ¶ added in v0.0.3
func (c LLMBashChain) OutputKeys() []string
OutputKeys returns the output keys the chain will return.
type LLMBashChainOptions ¶ added in v0.0.3
type LLMChain ¶
type LLMChain struct {
// contains filtered or unexported fields
}
func NewLLMChain ¶
func (LLMChain) Apply ¶ added in v0.0.8
func (c LLMChain) Apply(ctx context.Context, inputs []schema.ChainValues) ([]schema.ChainValues, error)
func (LLMChain) Call ¶ added in v0.0.2
func (c LLMChain) Call(ctx context.Context, inputs schema.ChainValues) (schema.ChainValues, error)
func (LLMChain) InputKeys ¶ added in v0.0.2
func (c LLMChain) InputKeys() []string
InputKeys returns the expected input keys.
func (LLMChain) OutputKeys ¶ added in v0.0.2
func (c LLMChain) OutputKeys() []string
OutputKeys returns the output keys the chain will return.
type LLMChainOptions ¶
type LLMChainOptions struct { OutputKey string OutputParser schema.OutputParser[any] // contains filtered or unexported fields }
type RefineDocumentsChain ¶
type RefineDocumentsChain struct {
// contains filtered or unexported fields
}
func NewRefineDocumentsChain ¶
func NewRefineDocumentsChain(llmChain *LLMChain, refineLLMChain *LLMChain) (*RefineDocumentsChain, error)
func NewRefineSummarizationChain ¶
func NewRefineSummarizationChain(llm schema.LLM, optFns ...func(o *RefineSummarizationChainOptions)) (*RefineDocumentsChain, error)
func (RefineDocumentsChain) Apply ¶ added in v0.0.8
func (c RefineDocumentsChain) Apply(ctx context.Context, inputs []schema.ChainValues) ([]schema.ChainValues, error)
func (RefineDocumentsChain) Call ¶ added in v0.0.2
func (c RefineDocumentsChain) Call(ctx context.Context, inputs schema.ChainValues) (schema.ChainValues, error)
func (RefineDocumentsChain) InputKeys ¶ added in v0.0.2
func (c RefineDocumentsChain) InputKeys() []string
InputKeys returns the expected input keys.
func (RefineDocumentsChain) OutputKeys ¶ added in v0.0.2
func (c RefineDocumentsChain) OutputKeys() []string
OutputKeys returns the output keys the chain will return.
type RefineDocumentsOptions ¶
type RefineSummarizationChainOptions ¶ added in v0.0.7
type RefineSummarizationChainOptions struct {
// contains filtered or unexported fields
}
type RetrievalQA ¶ added in v0.0.2
type RetrievalQA struct {
// contains filtered or unexported fields
}
func NewRetrievalQA ¶ added in v0.0.2
func NewRetrievalQA(stuffDocumentsChain *StuffDocumentsChain, retriever schema.Retriever) (*RetrievalQA, error)
func NewRetrievalQAFromLLM ¶ added in v0.0.2
func (RetrievalQA) Apply ¶ added in v0.0.8
func (c RetrievalQA) Apply(ctx context.Context, inputs []schema.ChainValues) ([]schema.ChainValues, error)
func (RetrievalQA) Call ¶ added in v0.0.2
func (c RetrievalQA) Call(ctx context.Context, inputs schema.ChainValues) (schema.ChainValues, error)
func (RetrievalQA) InputKeys ¶ added in v0.0.2
func (c RetrievalQA) InputKeys() []string
InputKeys returns the expected input keys.
func (RetrievalQA) OutputKeys ¶ added in v0.0.2
func (c RetrievalQA) OutputKeys() []string
OutputKeys returns the output keys the chain will return.
type RetrievalQAOptions ¶ added in v0.0.2
type StuffDocumentsChain ¶
type StuffDocumentsChain struct {
// contains filtered or unexported fields
}
func NewStuffDocumentsChain ¶
func NewStuffDocumentsChain(llmChain *LLMChain, optFns ...func(o *StuffDocumentsOptions)) (*StuffDocumentsChain, error)
func NewStuffSummarizationChain ¶
func NewStuffSummarizationChain(llm schema.LLM, optFns ...func(o *StuffSummarizationChainOptions)) (*StuffDocumentsChain, error)
func (StuffDocumentsChain) Apply ¶ added in v0.0.8
func (c StuffDocumentsChain) Apply(ctx context.Context, inputs []schema.ChainValues) ([]schema.ChainValues, error)
func (StuffDocumentsChain) Call ¶ added in v0.0.2
func (c StuffDocumentsChain) Call(ctx context.Context, inputs schema.ChainValues) (schema.ChainValues, error)
func (StuffDocumentsChain) InputKeys ¶ added in v0.0.2
func (c StuffDocumentsChain) InputKeys() []string
InputKeys returns the expected input keys.
func (StuffDocumentsChain) OutputKeys ¶ added in v0.0.2
func (c StuffDocumentsChain) OutputKeys() []string
OutputKeys returns the output keys the chain will return.
type StuffDocumentsOptions ¶
type StuffSummarizationChainOptions ¶ added in v0.0.7
type StuffSummarizationChainOptions struct {
// contains filtered or unexported fields
}
type TransformChain ¶ added in v0.0.6
type TransformChain struct {
// contains filtered or unexported fields
}
func NewTransformChain ¶ added in v0.0.6
func NewTransformChain(inputKeys, outputKeys []string, transform TransformFunc) (*TransformChain, error)
func (TransformChain) Apply ¶ added in v0.0.8
func (c TransformChain) Apply(ctx context.Context, inputs []schema.ChainValues) ([]schema.ChainValues, error)
func (TransformChain) Call ¶ added in v0.0.6
func (c TransformChain) Call(ctx context.Context, inputs schema.ChainValues) (schema.ChainValues, error)
func (TransformChain) InputKeys ¶ added in v0.0.6
func (c TransformChain) InputKeys() []string
InputKeys returns the expected input keys.
func (TransformChain) OutputKeys ¶ added in v0.0.6
func (c TransformChain) OutputKeys() []string
OutputKeys returns the output keys the chain will return.
type TransformFunc ¶ added in v0.0.6
type TransformFunc func(inputs schema.ChainValues) (schema.ChainValues, error)
Click to show internal directories.
Click to hide internal directories.