chain

package
v1.8.6 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2025 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainStep

type ChainStep struct {
	ID          string         `json:"id,omitempty"` // alias for this step
	ToolName    string         `json:"tool_name"`
	Inputs      map[string]any `json:"inputs,omitempty"`
	UsePrevious bool           `json:"use_previous,omitempty"`
	Stream      bool           `json:"stream,omitempty"`
}

ChainStep defines one step in a Go-native UTCP tool chain.

type LanguageConfig

type LanguageConfig struct {
	Cmd          string
	Args         []string
	Extension    string
	CompileArgs  []string
	NeedsCompile bool
	RunCompiled  bool
}

--- Language Configurations ---

type ToolCaller

type ToolCaller interface {
	CallTool(ctx context.Context, toolName string, args map[string]any) (any, error)
	CallToolStream(ctx context.Context, toolName string, args map[string]any) (transports.StreamResult, error)
}

--- ToolCaller Interface ---

type UtcpChainClient added in v1.7.4

type UtcpChainClient struct {
	Client ToolCaller
}

--- Core UTCP Client ---

func NewChainModeUTCP added in v1.7.6

func NewChainModeUTCP(client utcp.UtcpClientInterface) *UtcpChainClient

func (*UtcpChainClient) CallToolChain added in v1.7.4

func (c *UtcpChainClient) CallToolChain(
	ctx context.Context,
	steps []ChainStep,
	timeout time.Duration,
) (map[string]any, error)

CallToolChain executes a chain of steps with optional result passing and streaming support.

func (*UtcpChainClient) CallToolCode added in v1.7.4

func (c *UtcpChainClient) CallToolCode(
	ctx context.Context,
	tools map[string]func(map[string]any) (any, error),
	code string,
	timeout time.Duration,
) (any, error)

--- Yaegi Tool Executor ---

Jump to

Keyboard shortcuts

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