clienttool

package
v2.23.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 2 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

Overview

Package clienttool is the client-tool plumbing the AG-UI adapter (sdk/agui) needs from an sdk.Conversation and that is not part of the public SDK API: settling an answer now, as the model will be given it.

Package sdk registers the lookup in its init, so the adapter can reach a conversation's Settler without the methods being exported on it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(f func(conv any) Settler)

Register sets the lookup SettlerOf uses. Package sdk calls it in its init.

Types

type Settler

type Settler interface {
	// HasToolResultRewriters reports whether the conversation has a tool hook
	// that rewrites tool results.
	HasToolResultRewriters() bool
	// SettleClientTool answers the deferred client tool call callID and
	// prepares the tool result the model will be given for it; answered is
	// false for a call that already has an answer.
	SettleClientTool(ctx context.Context, callID string, result any, failure error) (
		prepared types.MessageToolResult, answered bool, err error)
	// SettleClientToolRejection is SettleClientTool for a rejection.
	SettleClientToolRejection(ctx context.Context, callID, reason string) (
		prepared types.MessageToolResult, answered bool, err error)
}

Settler settles client tool answers on a conversation.

func SettlerOf

func SettlerOf(conv any) Settler

SettlerOf returns conv's Settler, or nil when conv is not a conversation that settles answers.

Jump to

Keyboard shortcuts

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