tool_hooks_agent

command
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

README

Tool Hooks Agent Example

This example demonstrates tool execution hooks (pkg/agentgo/hooks) that fire before and after each tool call. A LoggingToolHook measures latency and logs success/failure, while a RateLimitHook shows how to block tool calls that exceed a threshold.

Prerequisites

  • Go 1.24+
  • OPENAI_API_KEY environment variable

How to Run

export OPENAI_API_KEY=sk-...
go run ./cmd/examples/tool_hooks_agent/

Documentation

Overview

Example: Agent with Tool Execution Hooks This example demonstrates how to use tool hooks to monitor and control tool execution.

Jump to

Keyboard shortcuts

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