toolbatch

package
v2026.1015.4 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanRunConcurrently

func CanRunConcurrently(invs []tooling.Invocation) bool

CanRunConcurrently reports whether a batch can use the shared runtime concurrently. These tools deliberately remain serialized with any sibling call because they mutate process-wide runtime state while they run.

Types

type Result

type Result struct {
	Value any
	Err   error
}

Result keeps the result for the invocation at the same index in the input batch. Keeping that association lets callers execute concurrently while still appending tool messages in the order requested by the model.

func Execute

func Execute(ctx context.Context, invs []tooling.Invocation, exec func(context.Context, tooling.Invocation) (any, error)) []Result

Execute starts every invocation in the batch before waiting for any result. The executor is responsible for honoring ctx. A failed invocation does not cancel its siblings: tool failures are represented by the corresponding Result so the model receives one result for every requested tool call.

Jump to

Keyboard shortcuts

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