chain

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2025 License: MPL-2.0 Imports: 17 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 UtcpClient

type UtcpClient struct {
	Client ToolCaller
}

--- Core UTCP Client ---

func (*UtcpClient) CallToolChain

func (c *UtcpClient) 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 (*UtcpClient) CallToolCode

func (c *UtcpClient) 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