Documentation
¶
Index ¶
- type AgentNode
- type BaseNode
- func (n *BaseNode) AddInputs(variables ...*core.Variable)
- func (n *BaseNode) Description() string
- func (n *BaseNode) Execute(ctx core.Context) error
- func (n *BaseNode) GetInputValues(ctx core.Context) (map[string]any, error)
- func (n *BaseNode) GetNodeContext(ctx core.Context) (*core.NodeContext, error)
- func (n *BaseNode) ID() string
- func (n *BaseNode) InputVariables() []*core.Variable
- func (n *BaseNode) Name() string
- func (n *BaseNode) SetID(id string)
- type BranchNode
- type ChatNode
- type ChatNodeOption
- type ChatTemplate
- type Function
- type FunctionNode
- type InputNode
- type Register
- type Service
- type ServiceNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentNode ¶
type AgentNode struct {
*BaseNode
// contains filtered or unexported fields
}
func NewAgentNode ¶
type BaseNode ¶
type BaseNode struct {
// contains filtered or unexported fields
}
BaseNode 基础节点实现
func NewBaseNode ¶
NewBaseNode 创建新的基础节点
func (*BaseNode) GetInputValues ¶
func (*BaseNode) GetNodeContext ¶
func (*BaseNode) InputVariables ¶
InputVariables 返回节点的输入变量列表
type BranchNode ¶
type BranchNode struct {
*BaseNode
// contains filtered or unexported fields
}
BranchNode 分支节点实现
func NewBranchNode ¶
func NewBranchNode(name, description, expression string) *BranchNode
NewBranchNode 创建新的分支节点
func (*BranchNode) AddTarget ¶
func (b *BranchNode) AddTarget(expressionResult any, targetNodeId string)
AddTarget 添加分支目标
type ChatNode ¶
type ChatNode struct {
*BaseNode
// contains filtered or unexported fields
}
ChatNode LLM节点实现
func NewChatNode ¶
func NewChatNode(name, description string, options ...ChatNodeOption) *ChatNode
NewChatNode 创建新的LLM节点
type ChatNodeOption ¶
type ChatNodeOption func(*ChatNode)
func WithCallOption ¶
func WithCallOption(callOptions ...llms.CallOption) ChatNodeOption
func WithInputs ¶
func WithInputs(inputs ...*core.Variable) ChatNodeOption
func WithLLMModel ¶
func WithLLMModel(model llms.Model) ChatNodeOption
func WithPromptTemplates ¶
func WithPromptTemplates(templates ...*ChatTemplate) ChatNodeOption
type ChatTemplate ¶
type ChatTemplate struct {
Content string
Role llms.ChatMessageType
InputVariables []string
}
type FunctionNode ¶
type FunctionNode struct {
*BaseNode
// contains filtered or unexported fields
}
FunctionNode 函数节点实现
func NewFunctionNode ¶
func NewFunctionNode(name, description string, executeFn Function, inputs ...*core.Variable) *FunctionNode
NewFunctionNode 创建新的函数节点
type Register ¶
type Register struct {
// contains filtered or unexported fields
}
func NewRegister ¶
func NewRegister() *Register
func (*Register) RegisterFunction ¶
func (*Register) RegisterService ¶
type ServiceNode ¶
type ServiceNode struct {
*BaseNode
// contains filtered or unexported fields
}
func NewServiceNode ¶
func NewServiceNode(name, description string, service Service, inputs ...*core.Variable) *ServiceNode
Click to show internal directories.
Click to hide internal directories.