Help us shape the future of Go! Take the 2026 Go Developer Survey

stopping_policy

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package stopping holds one stop policy per stop condition. wire.go picks one, so the engine never asks which mode it is in.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExternalFinish

type ExternalFinish struct{}

ExternalFinish runs until a stop signal, the iteration cap or a timeout.

func (ExternalFinish) AfterText

func (ExternalFinish) AfterText() (ends bool, nudge string)

func (ExternalFinish) FinishCall

func (ExternalFinish) FinishCall(*schema.Message) (schema.ToolCall, bool)

func (ExternalFinish) Instructions

func (ExternalFinish) Instructions() string

func (ExternalFinish) Label

func (ExternalFinish) Label() string

type FinishTool

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

FinishTool runs until the model calls the finish tool; its arguments are the final output. A text-only reply is the model narrating instead of acting, so it is nudged back to a tool call.

func NewFinishTool

func NewFinishTool(toolName, nudge string) FinishTool

func (FinishTool) AfterText

func (f FinishTool) AfterText() (ends bool, nudge string)

func (FinishTool) FinishCall

func (f FinishTool) FinishCall(reply *schema.Message) (schema.ToolCall, bool)

func (FinishTool) Instructions

func (f FinishTool) Instructions() string

finishtool.go

func (FinishTool) Label

func (FinishTool) Label() string

type NoToolFinish

type NoToolFinish struct{}

NoToolFinish ends the run when the model replies without calling a tool. Suits chat and question answering.

func (NoToolFinish) AfterText

func (NoToolFinish) AfterText() (ends bool, nudge string)

func (NoToolFinish) FinishCall

func (NoToolFinish) FinishCall(*schema.Message) (schema.ToolCall, bool)

func (NoToolFinish) Instructions

func (NoToolFinish) Instructions() string

func (NoToolFinish) Label

func (NoToolFinish) Label() string

Jump to

Keyboard shortcuts

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