Documentation
¶
Overview ¶
Package builder drafts a workflow from a plain-language description with a language model. The draft is a proposal for a person to review in the editor: it is validated and returned, never saved and never started.
Index ¶
Constants ¶
const ( TypeSource = "source" TypeSink = "sink" TypeTransformation = "transformation" )
Structural node types: they have no executor because the engine handles them itself, and every workflow needs them.
const MaxDescriptionLength = 4000
MaxDescriptionLength bounds the description sent to the model.
Variables ¶
var ErrDescriptionTooLong = errors.New("the description is too long")
ErrDescriptionTooLong is returned for a description over MaxDescriptionLength.
var ErrEmptyDescription = errors.New("describe the automation to draft")
ErrEmptyDescription is returned when there is nothing to draft from.
Functions ¶
This section is empty.
Types ¶
type Draft ¶
type Draft struct {
Workflow storage.Workflow
Issues []Issue
Provider string
Model string
Usage llm.Usage
}
Draft is the proposed workflow.
type Issue ¶
type Issue struct {
Severity string `json:"severity"`
Message string `json:"message"`
Recommendation string `json:"recommendation"`
NodeID string `json:"node_id,omitempty"`
}
Issue is a problem the builder found in the model's answer. It has the same shape as the workflow validator's issues so the two lists merge.
type Kind ¶
type Kind struct {
// Key names the kind in the prompt: the node type for a node executor,
// "transformation:<transType>" for a transformer.
Key string
// NodeType is the workflow node's type.
NodeType string
// TransType is config.transType for a transformation node.
TransType string
// Description tells the model what the node does and how it is set up.
Description string
}
Kind is one kind of node a draft may contain.