workflow

package
v0.0.0-...-a6a9895 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Step

type Step struct {
	ID    string                   `yaml:"id,omitempty"`
	Name  string                   `yaml:"name"`
	Uses  string                   `yaml:"uses,omitempty"`
	Model model.ModelConfiguration `yaml:"model,omitempty"`
	Run   string                   `yaml:"run,omitempty"`  // Run is an operation to be preformed by the model
	With  map[string]interface{}   `yaml:"with,omitempty"` // With is the parameters to be passed to the tool.
	Log   bool                     `yaml:"log,omitempty"`  // Log is a flag wether the output of the tool should be logged to the console.
}

type Workflow

type Workflow struct {
	// contains filtered or unexported fields
}

Workflow represents your parsed and built workflow.

func (*Workflow) Init

func (wf *Workflow) Init() error

Initializes the models used in the workflow.

func (*Workflow) Run

func (wf *Workflow) Run() error

func (*Workflow) ValidateAndBuildWorkflow

func (wf *Workflow) ValidateAndBuildWorkflow(data *WorkflowSchema, cfg *viper.Viper) error

type WorkflowNode

type WorkflowNode struct {
	StepName  string
	ID        string
	Params    map[string]interface{}
	Operation string
	Tool      tool.Tool
	Model     model.Model
	Next      string // The ID of the next node to run
	Output    string
	Log       bool
}

A WorkflowNode represents a step in the workflow.

func (*WorkflowNode) Run

func (n *WorkflowNode) Run(outputs map[string]string) (string, error)

type WorkflowSchema

type WorkflowSchema struct {
	Name  string `yaml:"name"`
	Steps []Step `yaml:"steps"`
}

func LoadSchema

func LoadSchema(workflowName string) (*WorkflowSchema, error)

Jump to

Keyboard shortcuts

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