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

agent

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2026 License: Apache-2.0 Imports: 4 Imported by: 16

Documentation

Overview

Package agent defines common option types used by agents and multi-agents.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChatModelWithTools added in v0.3.23

func ChatModelWithTools(cm model.ChatModel, toolCallingModel model.ToolCallingChatModel, toolInfos []*schema.ToolInfo) (
	model.BaseChatModel, error)

ChatModelWithTools returns a chat model configured with tool schemas. If a ToolCallingChatModel is provided, it is used directly (and optionally configured with tools). Otherwise, a plain ChatModel is bound with tools.

func GetComposeOptions

func GetComposeOptions(opts ...AgentOption) []compose.Option

GetComposeOptions returns all compose options from the given agent options.

func GetImplSpecificOptions

func GetImplSpecificOptions[T any](base *T, opts ...AgentOption) *T

GetImplSpecificOptions returns the implementation-specific options from the given agent options.

Types

type AgentOption

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

AgentOption is the common option type for various agent and multi-agent implementations. For options intended to use with underlying graph or components, use WithComposeOptions to specify. For options intended to use with particular agent/multi-agent implementations, use WrapImplSpecificOptFn to specify.

func WithComposeOptions

func WithComposeOptions(opts ...compose.Option) AgentOption

WithComposeOptions returns an agent option that specifies compose options.

func WrapImplSpecificOptFn

func WrapImplSpecificOptFn[T any](optFn func(*T)) AgentOption

WrapImplSpecificOptFn returns an agent option that specifies a function to modify the implementation-specific options.

Directories

Path Synopsis
multiagent
host
Package host implements the host pattern for multi-agent system.
Package host implements the host pattern for multi-agent system.
Package react provides helpers to build callback handlers for React agents.
Package react provides helpers to build callback handlers for React agents.

Jump to

Keyboard shortcuts

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