executor

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package executor provides registry-backed tool execution. It routes tool invocations through the registry gateway and awaits results on Pulse streams.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	CallTool(ctx context.Context, toolset string, tool tools.Ident, payload []byte, meta toolregistry.ToolCallMeta) (toolUseID string, err error)
}

Client initiates tool calls through a registry gateway.

type Executor

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

func New

func New(client Client, pulse pulsec.Client, specs SpecLookup, opts ...Option) *Executor

func (*Executor) Execute

type Option

type Option func(*Executor)

func WithLogger

func WithLogger(logger telemetry.Logger) Option

WithLogger configures the executor logger. When nil, the executor uses a noop logger.

func WithResultEventKey

func WithResultEventKey(key string) Option

WithResultEventKey sets the Pulse event name used for canonical ToolResultMessage payloads on per-call result streams.

func WithSinkName

func WithSinkName(name string) Option

WithSinkName sets the Pulse sink/consumer-group name used when subscribing to per-call result streams. Callers should use a stable name across restarts so pending entries are not orphaned in Redis.

func WithStreamSink

func WithStreamSink(sink aistream.Sink) Option

WithStreamSink configures the executor to forward best-effort tool output delta frames into the provided stream sink while it waits for the canonical tool result message. This does not affect tool execution semantics: the final tool result remains authoritative.

func WithTracer

func WithTracer(tracer telemetry.Tracer) Option

WithTracer configures the executor tracer. When nil, the executor uses a noop tracer.

type SpecLookup

type SpecLookup interface {
	Spec(name tools.Ident) (*tools.ToolSpec, bool)
}

SpecLookup resolves tool specifications for decoding results and server data.

Jump to

Keyboard shortcuts

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