Documentation ¶
Index ¶
- Constants
- func InitChain(ch Chain, log utils.TraceLog, opt Option) (err error)
- func InitLLMChain(ch LLMChain, llm llms.LLM, log utils.TraceLog, opt Option) (err error)
- func NewChainNode(desc string, ch Chain) *_ChainNode
- type Chain
- type LLMChain
- type Option
- type PromptChain
- func NewPromptChain(tmp prompt.Prompt, llm llms.LLM, log utils.TraceLog, opt Option) (ret *PromptChain, err error)
- func NewStringPromptChain(tmp string, llm llms.LLM, log utils.TraceLog, opt Option) (ret *PromptChain, err error)
- func NewTemplatePromptChain(tmp string, llm llms.LLM, log utils.TraceLog, opt Option) (ret *PromptChain, err error)
- type PromptToolChain
- func NewPromptToolChain(tmp prompt.Prompt, llm llms.LLM, box llms.ToolBox, log utils.TraceLog, ...) (ret *PromptToolChain, err error)
- func NewStringPromptToolChain(tmp string, llm llms.LLM, box llms.ToolBox, log utils.TraceLog, opt Option) (ret *PromptToolChain, err error)
- func NewTemplatePromptToolChain(tmp string, llm llms.LLM, box llms.ToolBox, log utils.TraceLog, opt Option) (ret *PromptToolChain, err error)
- type PromptToolChainBase
- type PromptToolChainEx
- func NewPromptToolChainEx(tmp prompt.Prompt, llm llms.LLM, box llms.ToolBox, log utils.TraceLog, ...) (ret *PromptToolChainEx, err error)
- func NewStringPromptToolChainEx(tmp string, llm llms.LLM, box llms.ToolBox, log utils.TraceLog, opt Option) (ret *PromptToolChainEx, err error)
- func NewTemplatePromptToolChainEx(tmp string, llm llms.LLM, box llms.ToolBox, log utils.TraceLog, opt Option) (ret *PromptToolChainEx, err error)
- type RouterChain
- func (ch *RouterChain) Add(name, desc string, node Chain)
- func (ch *RouterChain) Delete(name string)
- func (ch *RouterChain) Desc() string
- func (ch *RouterChain) Init() error
- func (ch *RouterChain) Run(ctx context.Context, input *llms.Input) (ret *llms.Output, err error)
- func (ch *RouterChain) SetOption(opt Option) error
- type RouterOption
- func (op *RouterOption) GetInput() []string
- func (op *RouterOption) GetOutput() string
- func (op *RouterOption) GetParamManager() utils.ParamsChainManager
- func (op *RouterOption) GetRoleName() string
- func (op *RouterOption) SetInput(v ...string) Option
- func (op *RouterOption) SetOutput(v string) Option
- func (op *RouterOption) SetParamManager(pm utils.ParamsChainManager) Option
- func (op *RouterOption) SetRoleName(v string) Option
- func (op *RouterOption) SetRouterParser(router router.Parser) *RouterOption
- type SequenceChain
- type SimpleChain
- func (ch *SimpleChain) Desc() string
- func (ch *SimpleChain) GetOption() Option
- func (ch *SimpleChain) GetTraceLog() utils.TraceLog
- func (ch *SimpleChain) Init() error
- func (ch *SimpleChain) Run(_ context.Context, _ *llms.Input) (*llms.Output, error)
- func (ch *SimpleChain) SetOption(opt Option) error
- func (ch *SimpleChain) SetTraceLog(log utils.TraceLog) error
- type SimpleLLMChain
- type SimpleOption
- func (op *SimpleOption) GetInput() []string
- func (op *SimpleOption) GetOutput() string
- func (op *SimpleOption) GetParamManager() utils.ParamsChainManager
- func (op *SimpleOption) GetRoleName() string
- func (op *SimpleOption) SetInput(v ...string) Option
- func (op *SimpleOption) SetOutput(v string) Option
- func (op *SimpleOption) SetParamManager(pm utils.ParamsChainManager) Option
- func (op *SimpleOption) SetRoleName(v string) Option
Constants ¶
View Source
const (
DefaultOptionOutputKey = "output"
)
View Source
const (
LLMRequestLimit = 10
)
View Source
const (
ToolLLMRequestLimit = 10
)
Variables ¶
This section is empty.
Functions ¶
func InitLLMChain ¶
func NewChainNode ¶
Types ¶
type Option ¶
type PromptChain ¶
type PromptChain struct { SimpleLLMChain // contains filtered or unexported fields }
func NewPromptChain ¶
func NewStringPromptChain ¶
func NewTemplatePromptChain ¶
func (*PromptChain) Desc ¶
func (ch *PromptChain) Desc() string
type PromptToolChain ¶ added in v0.0.2
type PromptToolChain struct {
PromptToolChainBase
}
func NewPromptToolChain ¶ added in v0.0.2
func NewStringPromptToolChain ¶ added in v0.0.2
func NewTemplatePromptToolChain ¶ added in v0.0.2
type PromptToolChainBase ¶ added in v0.0.4
type PromptToolChainBase struct { PromptChain // contains filtered or unexported fields }
func (*PromptToolChainBase) Desc ¶ added in v0.0.4
func (ch *PromptToolChainBase) Desc() string
func (*PromptToolChainBase) GetToolBox ¶ added in v0.0.4
func (ch *PromptToolChainBase) GetToolBox() llms.ToolBox
func (*PromptToolChainBase) SetLLM ¶ added in v0.0.4
func (ch *PromptToolChainBase) SetLLM(llm llms.LLM) error
func (*PromptToolChainBase) SetToolBox ¶ added in v0.0.4
func (ch *PromptToolChainBase) SetToolBox(box llms.ToolBox) error
type PromptToolChainEx ¶ added in v0.0.4
type PromptToolChainEx struct {
PromptToolChainBase
}
func NewPromptToolChainEx ¶ added in v0.0.4
func NewStringPromptToolChainEx ¶ added in v0.0.4
func NewTemplatePromptToolChainEx ¶ added in v0.0.4
type RouterChain ¶
type RouterChain struct { SimpleLLMChain // contains filtered or unexported fields }
func NewRouterChain ¶
func (*RouterChain) Add ¶
func (ch *RouterChain) Add(name, desc string, node Chain)
func (*RouterChain) Delete ¶
func (ch *RouterChain) Delete(name string)
func (*RouterChain) Desc ¶
func (ch *RouterChain) Desc() string
func (*RouterChain) Init ¶
func (ch *RouterChain) Init() error
func (*RouterChain) SetOption ¶
func (ch *RouterChain) SetOption(opt Option) error
type RouterOption ¶
type RouterOption struct { SimpleOption // contains filtered or unexported fields }
func NewRouterOption ¶
func NewRouterOption() *RouterOption
func (*RouterOption) GetInput ¶
func (op *RouterOption) GetInput() []string
func (*RouterOption) GetOutput ¶
func (op *RouterOption) GetOutput() string
func (*RouterOption) GetParamManager ¶
func (op *RouterOption) GetParamManager() utils.ParamsChainManager
func (*RouterOption) GetRoleName ¶
func (op *RouterOption) GetRoleName() string
func (*RouterOption) SetInput ¶
func (op *RouterOption) SetInput(v ...string) Option
func (*RouterOption) SetOutput ¶
func (op *RouterOption) SetOutput(v string) Option
func (*RouterOption) SetParamManager ¶
func (op *RouterOption) SetParamManager(pm utils.ParamsChainManager) Option
func (*RouterOption) SetRoleName ¶
func (op *RouterOption) SetRoleName(v string) Option
func (*RouterOption) SetRouterParser ¶
func (op *RouterOption) SetRouterParser(router router.Parser) *RouterOption
type SequenceChain ¶
type SequenceChain struct { SimpleChain // contains filtered or unexported fields }
func NewSequenceChain ¶
func NewSequenceChain(log utils.TraceLog, opt Option) (ret *SequenceChain, err error)
func (*SequenceChain) Desc ¶
func (ch *SequenceChain) Desc() string
func (*SequenceChain) Pop ¶
func (ch *SequenceChain) Pop()
func (*SequenceChain) Push ¶
func (ch *SequenceChain) Push(desc string, node Chain)
type SimpleChain ¶
type SimpleChain struct {
// contains filtered or unexported fields
}
func (*SimpleChain) Desc ¶
func (ch *SimpleChain) Desc() string
func (*SimpleChain) GetOption ¶
func (ch *SimpleChain) GetOption() Option
func (*SimpleChain) GetTraceLog ¶
func (ch *SimpleChain) GetTraceLog() utils.TraceLog
func (*SimpleChain) Init ¶
func (ch *SimpleChain) Init() error
func (*SimpleChain) SetOption ¶
func (ch *SimpleChain) SetOption(opt Option) error
func (*SimpleChain) SetTraceLog ¶
func (ch *SimpleChain) SetTraceLog(log utils.TraceLog) error
type SimpleLLMChain ¶
type SimpleLLMChain struct { SimpleChain // contains filtered or unexported fields }
func (*SimpleLLMChain) GetLLM ¶
func (ch *SimpleLLMChain) GetLLM() llms.LLM
func (*SimpleLLMChain) Init ¶
func (ch *SimpleLLMChain) Init() error
type SimpleOption ¶
type SimpleOption struct {
// contains filtered or unexported fields
}
func (*SimpleOption) GetInput ¶
func (op *SimpleOption) GetInput() []string
func (*SimpleOption) GetOutput ¶
func (op *SimpleOption) GetOutput() string
func (*SimpleOption) GetParamManager ¶
func (op *SimpleOption) GetParamManager() utils.ParamsChainManager
func (*SimpleOption) GetRoleName ¶
func (op *SimpleOption) GetRoleName() string
func (*SimpleOption) SetInput ¶
func (op *SimpleOption) SetInput(v ...string) Option
func (*SimpleOption) SetOutput ¶
func (op *SimpleOption) SetOutput(v string) Option
func (*SimpleOption) SetParamManager ¶
func (op *SimpleOption) SetParamManager(pm utils.ParamsChainManager) Option
func (*SimpleOption) SetRoleName ¶
func (op *SimpleOption) SetRoleName(v string) Option
Source Files ¶
Click to show internal directories.
Click to hide internal directories.