Documentation
¶
Index ¶
- func GetTypedArg[T any](p *ExecutorParams, argName string) (T, error)
- func GetTypedResult[T any](res *ExecutorResult, argName string) (T, bool)
- type ErrArgMissing
- type ErrInvalidArgumentType
- type ErrInvalidParams
- type ErrOperatorNotFound
- type Executor
- type ExecutorParamOption
- type ExecutorParams
- func (p ExecutorParams) Copy() *ExecutorParams
- func (p ExecutorParams) GetArg(argName string) (any, error)
- func (p ExecutorParams) GetQuery() string
- func (p ExecutorParams) GetTaskID() string
- func (p *ExecutorParams) SetBranches(branches []*WorkflowBranch)
- func (p *ExecutorParams) SetChildren(children []*WorkflowNode)
- func (p *ExecutorParams) SetQuery(q string)
- func (p *ExecutorParams) SetRoutes(routes []*WorkflowRoute)
- func (p ExecutorParams) WithQuery(q string) *ExecutorParams
- type ExecutorResult
- type Workflow
- type WorkflowBranch
- type WorkflowNode
- type WorkflowRoute
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTypedArg ¶
func GetTypedArg[T any](p *ExecutorParams, argName string) (T, error)
func GetTypedResult ¶
func GetTypedResult[T any](res *ExecutorResult, argName string) (T, bool)
Types ¶
type ErrArgMissing ¶
type ErrArgMissing struct {
ArgName string
}
func (ErrArgMissing) Error ¶
func (e ErrArgMissing) Error() string
type ErrInvalidArgumentType ¶
func (ErrInvalidArgumentType) Error ¶
func (e ErrInvalidArgumentType) Error() string
type ErrInvalidParams ¶
func (ErrInvalidParams) Error ¶
func (e ErrInvalidParams) Error() string
type ErrOperatorNotFound ¶
func (ErrOperatorNotFound) Error ¶
func (e ErrOperatorNotFound) Error() string
type Executor ¶
type Executor interface {
Execute(ctx context.Context, params *ExecutorParams) *ExecutorResult
}
type ExecutorParamOption ¶
type ExecutorParamOption func(*ExecutorParams)
func WithArgs ¶
func WithArgs(args map[string]any) ExecutorParamOption
func WithOperator ¶
func WithOperator(op string) ExecutorParamOption
func WithTransport ¶
func WithTransport(t transport.Transport) ExecutorParamOption
func WithVectorStore ¶
func WithVectorStore(vs vector.Store) ExecutorParamOption
type ExecutorParams ¶
type ExecutorParams struct {
Operator string
Transport transport.Transport
VectorStore vector.Store
Args map[string]any
Children []*WorkflowNode
Routes []*WorkflowRoute
Branches []*WorkflowBranch
// contains filtered or unexported fields
}
func MakeNodeParams ¶
func MakeNodeParams(node *WorkflowNode, sourceParams *ExecutorParams) *ExecutorParams
func NewExecutorParams ¶
func NewExecutorParams(id string, query string, options ...ExecutorParamOption) *ExecutorParams
func ProcessResult ¶
func ProcessResult(params *ExecutorParams, result *ExecutorResult) *ExecutorParams
func (ExecutorParams) Copy ¶
func (p ExecutorParams) Copy() *ExecutorParams
Copy creates a copy of the ExecutorParams object The returned copy excludes the following fields:
Children, Routes, Branches
func (ExecutorParams) GetQuery ¶
func (p ExecutorParams) GetQuery() string
func (ExecutorParams) GetTaskID ¶
func (p ExecutorParams) GetTaskID() string
func (*ExecutorParams) SetBranches ¶
func (p *ExecutorParams) SetBranches(branches []*WorkflowBranch)
func (*ExecutorParams) SetChildren ¶
func (p *ExecutorParams) SetChildren(children []*WorkflowNode)
func (*ExecutorParams) SetQuery ¶
func (p *ExecutorParams) SetQuery(q string)
func (*ExecutorParams) SetRoutes ¶
func (p *ExecutorParams) SetRoutes(routes []*WorkflowRoute)
func (ExecutorParams) WithQuery ¶
func (p ExecutorParams) WithQuery(q string) *ExecutorParams
type ExecutorResult ¶
type Workflow ¶
type Workflow struct {
// contains filtered or unexported fields
}
func NewWorkflow ¶
func (Workflow) Execute ¶
func (w Workflow) Execute(ctx context.Context, params *ExecutorParams) *ExecutorResult
type WorkflowBranch ¶
type WorkflowBranch struct {
Name string
Nodes []*WorkflowNode
}
type WorkflowNode ¶
type WorkflowNode struct {
Executor Executor
Operator string
NodeType string
Args map[string]any
Children []*WorkflowNode
Routes []*WorkflowRoute
Branches []*WorkflowBranch
}
func NewWorkflowNode ¶
func NewWorkflowNode(executor Executor, operator string, nodeType string) *WorkflowNode
func (WorkflowNode) Execute ¶
func (n WorkflowNode) Execute(ctx context.Context, params *ExecutorParams) *ExecutorResult
type WorkflowRoute ¶
type WorkflowRoute struct {
Key string
Description string
Nodes []*WorkflowNode
}
Click to show internal directories.
Click to hide internal directories.