Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chain ¶
type Chain struct {
// Next is the Chain called after formatting the documents.
Next llm.Chain
// Input key is the input key the StuffDocuments chain expects the
// documents to be in.
InputKey string
// DocumentVariableName is the variable name used in the llm_chain to put
// the documents in.
DocumentVariableName string
// Separator is the string used to join the documents.
Separator string
}
Chain that combines documents with a separator and uses the stuffed documents in an llm.Chain. The input values to the llm chain contains all input values given to this chain, and the stuffed document as a string in the key specified by the "DocumentVariableName" field that is by default set to "context".
func New ¶
New creates a new stuff documents chain with an LLM chain used after formatting the documents.
func (Chain) Call ¶
func (c Chain) Call(ctx context.Context, values map[string]any, options ...llm.ChainOption) (map[string]any, error)
Call handles the inner logic of the StuffDocuments chain.
func (Chain) OutputKeys ¶
OutputKeys returns the output keys the chain will return.
Click to show internal directories.
Click to hide internal directories.