tools

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchGitCommits

func FetchGitCommits(ctx context.Context, workingDir, base, head string) (string, error)

FetchGitCommits returns a bulleted list of commit subjects (first line of message) between base and head, excluding merge commits.

func FetchGitDiff

func FetchGitDiff(ctx context.Context, workingDir, base, head string, ignoredLockFiles []string) (string, []string, error)

func RegisterLocalTools

func RegisterLocalTools(r *Registry, root string, ignoredLockFiles []string, wishlistDir string)

func RegisterToolWithArgs added in v0.5.0

func RegisterToolWithArgs[T any](r *Registry, def llm.ToolDef, handler func(context.Context, T) (string, error))

RegisterToolWithArgs registers a tool that uses a specific struct for its arguments. It handles unmarshaling the arguments and returns an error if they are malformed.

Types

type Registry

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

func NewRegistry

func NewRegistry() *Registry

func (*Registry) HandleCall

func (r *Registry) HandleCall(ctx context.Context, tc llm.ToolCall) (string, error)

func (*Registry) RegisterTool

func (r *Registry) RegisterTool(def llm.ToolDef, handler ToolHandler)

func (*Registry) ToTools

func (r *Registry) ToTools() []llm.ToolDef

type ToolHandler

type ToolHandler func(ctx context.Context, tc llm.ToolCall) (string, error)

Directories

Path Synopsis
mcp_servers

Jump to

Keyboard shortcuts

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