done

package
v0.0.0-beta Latest Latest
Warning

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

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

Documentation

Overview

Package done provides a tool for the LLM to explicitly signal task completion.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Inputs

type Inputs struct {
	Summary string `json:"summary" jsonschema:"required,description=Final summary of what was accomplished"`
}

Inputs defines the parameters for the Done tool.

type Tool

type Tool struct {
	tool.Base

	// OnDone is called when the LLM invokes this tool.
	// The assistant sets this callback to signal loop exit.
	OnDone func(summary string)
}

Tool signals task completion. When called, it sets a flag that exits the assistant loop.

func New

func New(onDone func(string)) *Tool

New creates a Done tool with the given callback.

func (*Tool) Execute

func (t *Tool) Execute(_ context.Context, args map[string]any) (string, error)

Execute signals task completion via the OnDone callback.

func (*Tool) Name

func (t *Tool) Name() string

Name returns the tool's identifier.

func (*Tool) Parallel

func (t *Tool) Parallel() bool

Parallel returns false because Done sets the doneSignaled flag and must be the last tool executed.

func (*Tool) Sandboxable

func (t *Tool) Sandboxable() bool

Sandboxable returns false as this tool has no filesystem operations.

func (*Tool) Schema

func (t *Tool) Schema() tool.Schema

Schema returns the provider-agnostic tool definition.

Jump to

Keyboard shortcuts

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