Documentation
¶
Index ¶
- Variables
- type Conversation
- func (bc Conversation) Apply(ctx context.Context, inputs []schema.ChainValues) ([]schema.ChainValues, error)
- func (bc Conversation) Call(ctx context.Context, inputs schema.ChainValues) (schema.ChainValues, error)
- func (bc Conversation) InputKeys() []string
- func (bc Conversation) OutputKeys() []string
- func (c *Conversation) Predict(ctx context.Context, inputs schema.ChainValues) (string, error)
- func (c *Conversation) Prompt() *prompt.Template
- func (bc Conversation) Run(ctx context.Context, input any) (string, error)
- type ConversationOptions
- type LLMBashChain
- func (bc LLMBashChain) Apply(ctx context.Context, inputs []schema.ChainValues) ([]schema.ChainValues, error)
- func (bc LLMBashChain) Call(ctx context.Context, inputs schema.ChainValues) (schema.ChainValues, error)
- func (bc LLMBashChain) InputKeys() []string
- func (bc LLMBashChain) OutputKeys() []string
- func (bc LLMBashChain) Run(ctx context.Context, input any) (string, error)
- type LLMBashChainOptions
- type LLMChain
- func (bc LLMChain) Apply(ctx context.Context, inputs []schema.ChainValues) ([]schema.ChainValues, error)
- func (bc LLMChain) Call(ctx context.Context, inputs schema.ChainValues) (schema.ChainValues, error)
- func (bc LLMChain) InputKeys() []string
- func (bc LLMChain) OutputKeys() []string
- func (c *LLMChain) Predict(ctx context.Context, inputs schema.ChainValues) (string, error)
- func (c *LLMChain) Prompt() *prompt.Template
- func (bc LLMChain) Run(ctx context.Context, input any) (string, error)
- type LLMChainOptions
- type RefineDocumentsChain
- func (bc RefineDocumentsChain) Apply(ctx context.Context, inputs []schema.ChainValues) ([]schema.ChainValues, error)
- func (bc RefineDocumentsChain) Call(ctx context.Context, inputs schema.ChainValues) (schema.ChainValues, error)
- func (bc RefineDocumentsChain) InputKeys() []string
- func (bc RefineDocumentsChain) OutputKeys() []string
- func (bc RefineDocumentsChain) Run(ctx context.Context, input any) (string, error)
- type RefineDocumentsOptions
- type RefineSummarizationChainOptions
- type RetrievalQA
- func (bc RetrievalQA) Apply(ctx context.Context, inputs []schema.ChainValues) ([]schema.ChainValues, error)
- func (bc RetrievalQA) Call(ctx context.Context, inputs schema.ChainValues) (schema.ChainValues, error)
- func (bc RetrievalQA) InputKeys() []string
- func (bc RetrievalQA) OutputKeys() []string
- func (bc RetrievalQA) Run(ctx context.Context, input any) (string, error)
- type RetrievalQAOptions
- type StuffDocumentsChain
- func (bc StuffDocumentsChain) Apply(ctx context.Context, inputs []schema.ChainValues) ([]schema.ChainValues, error)
- func (bc StuffDocumentsChain) Call(ctx context.Context, inputs schema.ChainValues) (schema.ChainValues, error)
- func (bc StuffDocumentsChain) InputKeys() []string
- func (bc StuffDocumentsChain) OutputKeys() []string
- func (bc StuffDocumentsChain) Run(ctx context.Context, input any) (string, error)
- type StuffDocumentsOptions
- type StuffSummarizationChainOptions
- type TransformChain
- func (bc TransformChain) Apply(ctx context.Context, inputs []schema.ChainValues) ([]schema.ChainValues, error)
- func (bc TransformChain) Call(ctx context.Context, inputs schema.ChainValues) (schema.ChainValues, error)
- func (bc TransformChain) InputKeys() []string
- func (bc TransformChain) OutputKeys() []string
- func (bc TransformChain) Run(ctx context.Context, input any) (string, error)
- type TransformChainOptions
- type TransformFunc
Constants ¶
This section is empty.
Variables ¶
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 Conversation ¶ added in v0.0.10
type Conversation struct {
// contains filtered or unexported fields
}
func NewConversation ¶ added in v0.0.10
func NewConversation(llm schema.LLM, optFns ...func(o *ConversationOptions)) (*Conversation, error)
func (Conversation) Apply ¶ added in v0.0.10
func (bc Conversation) Apply(ctx context.Context, inputs []schema.ChainValues) ([]schema.ChainValues, error)
func (Conversation) Call ¶ added in v0.0.10
func (bc Conversation) Call(ctx context.Context, inputs schema.ChainValues) (schema.ChainValues, error)
func (Conversation) InputKeys ¶ added in v0.0.10
func (bc Conversation) InputKeys() []string
InputKeys returns the expected input keys.
func (Conversation) OutputKeys ¶ added in v0.0.10
func (bc Conversation) OutputKeys() []string
OutputKeys returns the output keys the chain will return.
func (*Conversation) Predict ¶ added in v0.0.10
func (c *Conversation) Predict(ctx context.Context, inputs schema.ChainValues) (string, error)
func (*Conversation) Prompt ¶ added in v0.0.10
func (c *Conversation) Prompt() *prompt.Template
type ConversationOptions ¶ added in v0.0.10
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, optFns ...func(o *LLMBashChainOptions)) (*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 (bc LLMBashChain) Apply(ctx context.Context, inputs []schema.ChainValues) ([]schema.ChainValues, error)
func (LLMBashChain) Call ¶ added in v0.0.3
func (bc LLMBashChain) Call(ctx context.Context, inputs schema.ChainValues) (schema.ChainValues, error)
func (LLMBashChain) InputKeys ¶ added in v0.0.3
func (bc LLMBashChain) InputKeys() []string
InputKeys returns the expected input keys.
func (LLMBashChain) OutputKeys ¶ added in v0.0.3
func (bc 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 (bc LLMChain) Apply(ctx context.Context, inputs []schema.ChainValues) ([]schema.ChainValues, error)
func (LLMChain) Call ¶ added in v0.0.2
func (bc LLMChain) Call(ctx context.Context, inputs schema.ChainValues) (schema.ChainValues, error)
func (LLMChain) InputKeys ¶ added in v0.0.2
func (bc LLMChain) InputKeys() []string
InputKeys returns the expected input keys.
func (LLMChain) OutputKeys ¶ added in v0.0.2
func (bc LLMChain) OutputKeys() []string
OutputKeys returns the output keys the chain will return.
type LLMChainOptions ¶
type RefineDocumentsChain ¶
type RefineDocumentsChain struct {
// contains filtered or unexported fields
}
func NewRefineDocumentsChain ¶
func NewRefineDocumentsChain(llmChain *LLMChain, refineLLMChain *LLMChain, optFns ...func(o *RefineDocumentsOptions)) (*RefineDocumentsChain, error)
func NewRefineSummarizationChain ¶
func NewRefineSummarizationChain(llm schema.LLM, optFns ...func(o *RefineSummarizationChainOptions)) (*RefineDocumentsChain, error)
func (RefineDocumentsChain) Apply ¶ added in v0.0.8
func (bc RefineDocumentsChain) Apply(ctx context.Context, inputs []schema.ChainValues) ([]schema.ChainValues, error)
func (RefineDocumentsChain) Call ¶ added in v0.0.2
func (bc RefineDocumentsChain) Call(ctx context.Context, inputs schema.ChainValues) (schema.ChainValues, error)
func (RefineDocumentsChain) InputKeys ¶ added in v0.0.2
func (bc RefineDocumentsChain) InputKeys() []string
InputKeys returns the expected input keys.
func (RefineDocumentsChain) OutputKeys ¶ added in v0.0.2
func (bc 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, optFns ...func(o *RetrievalQAOptions)) (*RetrievalQA, error)
func NewRetrievalQAFromLLM ¶ added in v0.0.2
func (RetrievalQA) Apply ¶ added in v0.0.8
func (bc RetrievalQA) Apply(ctx context.Context, inputs []schema.ChainValues) ([]schema.ChainValues, error)
func (RetrievalQA) Call ¶ added in v0.0.2
func (bc RetrievalQA) Call(ctx context.Context, inputs schema.ChainValues) (schema.ChainValues, error)
func (RetrievalQA) InputKeys ¶ added in v0.0.2
func (bc RetrievalQA) InputKeys() []string
InputKeys returns the expected input keys.
func (RetrievalQA) OutputKeys ¶ added in v0.0.2
func (bc 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 (bc StuffDocumentsChain) Apply(ctx context.Context, inputs []schema.ChainValues) ([]schema.ChainValues, error)
func (StuffDocumentsChain) Call ¶ added in v0.0.2
func (bc StuffDocumentsChain) Call(ctx context.Context, inputs schema.ChainValues) (schema.ChainValues, error)
func (StuffDocumentsChain) InputKeys ¶ added in v0.0.2
func (bc StuffDocumentsChain) InputKeys() []string
InputKeys returns the expected input keys.
func (StuffDocumentsChain) OutputKeys ¶ added in v0.0.2
func (bc 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, optFns ...func(o *TransformChainOptions)) (*TransformChain, error)
func (TransformChain) Apply ¶ added in v0.0.8
func (bc TransformChain) Apply(ctx context.Context, inputs []schema.ChainValues) ([]schema.ChainValues, error)
func (TransformChain) Call ¶ added in v0.0.6
func (bc TransformChain) Call(ctx context.Context, inputs schema.ChainValues) (schema.ChainValues, error)
func (TransformChain) InputKeys ¶ added in v0.0.6
func (bc TransformChain) InputKeys() []string
InputKeys returns the expected input keys.
func (TransformChain) OutputKeys ¶ added in v0.0.6
func (bc TransformChain) OutputKeys() []string
OutputKeys returns the output keys the chain will return.
type TransformChainOptions ¶ added in v0.0.9
type TransformChainOptions struct {
// contains filtered or unexported fields
}
type TransformFunc ¶ added in v0.0.6
type TransformFunc func(inputs schema.ChainValues) (schema.ChainValues, error)