retryandreflect

package
v1.1.14 Latest Latest
Warning

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

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

Documentation

Overview

Package retryandreflect provides a plugin that provides self-healing, concurrent-safe error recovery for tool failures.

This is the Go version of the Python plugin. See https://github.com/google/adk-py/blob/main/google/adk/plugins/retry_and_reflect_plugin.py

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustNew

func MustNew(opts ...PluginOption) *plugin.Plugin

MustNew creates a new reflect and retry tool plugin and panics if it fails.

func New

func New(opts ...PluginOption) (*plugin.Plugin, error)

New creates a new reflect and retry tool plugin.

Types

type PluginOption

type PluginOption func(*retryAndReflect)

PluginOption is an option for configuring the ReflectAndRetryToolPlugin.

func WithErrorIfRetryExceeded

func WithErrorIfRetryExceeded(errorIfRetryExceeded bool) PluginOption

WithErrorIfRetryExceeded sets whether to return an error if the retry limit is exceeded. If set to true, then the original error is returned, otherwise instead of the original error, the plugin will return a new instruction "createToolRetryExceedMsg" telling LLM to stop using this tool for the current task.

func WithMaxRetries

func WithMaxRetries(maxRetries int) PluginOption

WithMaxRetries sets the maximum number of retries for a tool.

func WithTrackingScope

func WithTrackingScope(scope TrackingScope) PluginOption

WithTrackingScope sets the tracking scope for tool failures.

type TrackingScope

type TrackingScope string

TrackingScope defines the lifecycle scope for tracking tool failure counts.

const (
	// Invocation tracks failures per-invocation.
	Invocation TrackingScope = "invocation"
	// Global tracks failures globally across all turns and users.
	Global TrackingScope = "global"
)

Jump to

Keyboard shortcuts

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