Documentation ¶
Index ¶
- Variables
- func Apply(ctx context.Context, chain golc.Chain, inputs []golc.ChainValues) ([]golc.ChainValues, error)
- func Call(ctx context.Context, chain golc.Chain, inputs golc.ChainValues) (golc.ChainValues, error)
- func Run(ctx context.Context, chain golc.Chain, input any) (string, error)
- type LLMBashChain
- type LLMBashChainOptions
- type LLMChain
- func (c *LLMChain) Call(ctx context.Context, values golc.ChainValues) (golc.ChainValues, error)
- func (c *LLMChain) InputKeys() []string
- func (c *LLMChain) OutputKeys() []string
- func (c *LLMChain) Predict(ctx context.Context, values golc.ChainValues) (string, error)
- func (c *LLMChain) Prompt() *prompt.Template
- type LLMChainOptions
- type RefineDocumentsChain
- type RefineDocumentsOptions
- type RetrievalQA
- type RetrievalQAOptions
- type StuffDocumentsChain
- type StuffDocumentsOptions
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 ¶
func Apply ¶ added in v0.0.2
func Apply(ctx context.Context, chain golc.Chain, inputs []golc.ChainValues) ([]golc.ChainValues, error)
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(chain *LLMChain) (*LLMBashChain, error)
func NewLLMBashChainFromLLM ¶ added in v0.0.3
func NewLLMBashChainFromLLM(llm golc.LLM) (*LLMBashChain, error)
func (*LLMBashChain) Call ¶ added in v0.0.3
func (lc *LLMBashChain) Call(ctx context.Context, values golc.ChainValues) (golc.ChainValues, error)
func (*LLMBashChain) InputKeys ¶ added in v0.0.3
func (lc *LLMBashChain) InputKeys() []string
InputKeys returns the expected input keys.
func (*LLMBashChain) OutputKeys ¶ added in v0.0.3
func (lc *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 (*LLMChain) Call ¶ added in v0.0.2
func (c *LLMChain) Call(ctx context.Context, values golc.ChainValues) (golc.ChainValues, error)
func (*LLMChain) OutputKeys ¶ added in v0.0.2
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) (*RefineDocumentsChain, error)
func NewRefineSummarizationChain ¶
func NewRefineSummarizationChain(llm golc.LLM) (*RefineDocumentsChain, error)
func (*RefineDocumentsChain) Call ¶ added in v0.0.2
func (refine *RefineDocumentsChain) Call(ctx context.Context, values golc.ChainValues) (golc.ChainValues, error)
func (*RefineDocumentsChain) InputKeys ¶ added in v0.0.2
func (refine *RefineDocumentsChain) InputKeys() []string
InputKeys returns the expected input keys.
func (*RefineDocumentsChain) OutputKeys ¶ added in v0.0.2
func (refine *RefineDocumentsChain) OutputKeys() []string
OutputKeys returns the output keys the chain will return.
type RefineDocumentsOptions ¶
type RetrievalQA ¶ added in v0.0.2
type RetrievalQA struct {
// contains filtered or unexported fields
}
func NewRetrievalQA ¶ added in v0.0.2
func NewRetrievalQA(chain *StuffDocumentsChain, retriever golc.Retriever) (*RetrievalQA, error)
func NewRetrievalQAFromLLM ¶ added in v0.0.2
func (*RetrievalQA) Call ¶ added in v0.0.2
func (qa *RetrievalQA) Call(ctx context.Context, values golc.ChainValues) (golc.ChainValues, error)
func (*RetrievalQA) InputKeys ¶ added in v0.0.2
func (qa *RetrievalQA) InputKeys() []string
InputKeys returns the expected input keys.
func (*RetrievalQA) OutputKeys ¶ added in v0.0.2
func (qa *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) (*StuffDocumentsChain, error)
func NewStuffSummarizationChain ¶
func NewStuffSummarizationChain(llm golc.LLM) (*StuffDocumentsChain, error)
func (*StuffDocumentsChain) Call ¶ added in v0.0.2
func (stuff *StuffDocumentsChain) Call(ctx context.Context, values golc.ChainValues) (golc.ChainValues, error)
func (*StuffDocumentsChain) InputKeys ¶ added in v0.0.2
func (stuff *StuffDocumentsChain) InputKeys() []string
InputKeys returns the expected input keys.
func (*StuffDocumentsChain) OutputKeys ¶ added in v0.0.2
func (stuff *StuffDocumentsChain) OutputKeys() []string
OutputKeys returns the output keys the chain will return.
type StuffDocumentsOptions ¶
Click to show internal directories.
Click to hide internal directories.