nodes

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDynamicSaga

func NewDynamicSaga(name string, steps []SagaStep) *action.Builder[any, any]

func NewLoopAction

func NewLoopAction(
	bodyAction action.AnyAction,
	untilCondition string,
	maxTurns int,
) (*action.BuiltAction[any, any], error)

func NewProjectionAction

func NewProjectionAction(code string) (*action.BuiltAction[any, any], error)

NewProjectionAction compiles inline data shaping { key: expr } using precompiled expr bytecode. Supports standard expressions, JQ-style field prefixes ({ to: .user }), and root access ({ out: . }).

func NewPromptNode

func NewPromptNode(cfg PromptConfig) action.AnyAction

NewPromptNode creates a reusable, pre-configured prompt template action.

func NewSupervisorNode

func NewSupervisorNode(name string, compiler PipelineCompiler) action.AnyAction

NewSupervisorNode creates a main orchestrator node that compiles and controls child pipelines dynamically with panic isolation and leak protection.

Types

type ChildResult

type ChildResult struct {
	TaskID   string `json:"task_id"`
	Output   any    `json:"output,omitempty"`
	Error    string `json:"error,omitempty"`
	Duration int64  `json:"duration_ms"`
}

type ChildTask

type ChildTask struct {
	ID        string `json:"id"`
	DSL       string `json:"dsl"`
	Payload   any    `json:"payload"`
	TimeoutMS int64  `json:"timeout_ms,omitempty"`
}

type PipelineCompiler

type PipelineCompiler interface {
	CompilePipeline(expr string) (action.Executable, error)
}

type PromptConfig

type PromptConfig struct {
	Name          string         `json:"name"`
	Description   string         `json:"description"`
	SystemPrompt  string         `json:"system_prompt"`
	UserTemplate  string         `json:"user_template"`
	DefaultParams map[string]any `json:"default_params,omitempty"`
	Timeout       time.Duration  `json:"timeout,omitempty"`
}

type PromptReq

type PromptReq struct {
	Input  any            `json:"input,omitempty"`
	Params map[string]any `json:"params,omitempty"`
	Prompt string         `json:"prompt,omitempty"`
}

type PromptRes

type PromptRes struct {
	SystemPrompt string         `json:"system_prompt"`
	RenderedUser string         `json:"rendered_user"`
	Params       map[string]any `json:"params"`
}

type SagaStep

type SagaStep struct {
	NodeID     string
	Forward    action.AnyAction
	Compensate action.AnyAction
}

type SupervisorReq

type SupervisorReq struct {
	Tasks []ChildTask `json:"tasks" validate:"required"`
}

type SupervisorRes

type SupervisorRes struct {
	Total     int           `json:"total"`
	Succeeded int           `json:"succeeded"`
	Failed    int           `json:"failed"`
	Results   []ChildResult `json:"results"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL