agent

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentWrapper

type AgentWrapper struct {
	*BaseAgent
	ADKAgent agent.Agent
}

AgentWrapper wraps common agent initialization patterns

func NewAgentWrapper

func NewAgentWrapper(base *BaseAgent, adkAgent agent.Agent) *AgentWrapper

NewAgentWrapper creates a wrapper with both base functionality and ADK agent

type BaseAgent

type BaseAgent struct {
	Cfg          *config.Config
	Client       *http.Client
	Model        model.LLM
	ModelFactory *llm.ModelFactory
	Logger       *slog.Logger
}

BaseAgent provides common functionality for all agents

func NewBaseAgent

func NewBaseAgent(ctx context.Context, cfg *config.Config, timeoutSec int) (*BaseAgent, error)

NewBaseAgent creates a new base agent with LLM initialization

func NewBaseAgentWithLogger added in v0.5.0

func NewBaseAgentWithLogger(ctx context.Context, cfg *config.Config, timeoutSec int, logger *slog.Logger) (*BaseAgent, error)

NewBaseAgentWithLogger creates a new base agent with an explicit logger

func (*BaseAgent) Close added in v0.5.0

func (ba *BaseAgent) Close() error

Close cleans up resources including flushing observability data

func (*BaseAgent) Debug added in v0.5.0

func (ba *BaseAgent) Debug(msg string, args ...any)

Debug logs a debug message

func (*BaseAgent) Error added in v0.5.0

func (ba *BaseAgent) Error(msg string, args ...any)

Error logs an error message

func (*BaseAgent) FetchURL

func (ba *BaseAgent) FetchURL(ctx context.Context, url string, maxSizeMB int) (string, error)

FetchURL fetches content from a URL with proper error handling

func (*BaseAgent) GetProviderInfo

func (ba *BaseAgent) GetProviderInfo() string

GetProviderInfo returns information about the LLM provider

func (*BaseAgent) Info added in v0.5.0

func (ba *BaseAgent) Info(msg string, args ...any)

Info logs an informational message

func (*BaseAgent) Warn added in v0.5.0

func (ba *BaseAgent) Warn(msg string, args ...any)

Warn logs a warning message

Jump to

Keyboard shortcuts

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