agent

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package agent provides base agent functionality for building AI agents.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseAgent

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

BaseAgent provides common functionality for all agents.

func NewBaseAgent

func NewBaseAgent(cfg *config.Config, name string, timeoutSec int) (*BaseAgent, error)

NewBaseAgent creates a new base agent with LLM initialization.

func NewBaseAgentSecure

func NewBaseAgentSecure(ctx context.Context, name string, timeoutSec int, opts ...config.SecureConfigOption) (*BaseAgent, *config.SecureConfig, error)

NewBaseAgentSecure creates a base agent with VaultGuard security checks.

func (*BaseAgent) Close

func (ba *BaseAgent) Close() error

Close cleans up resources.

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) LogError

func (ba *BaseAgent) LogError(format string, args ...interface{})

LogError logs an error message with agent context.

func (*BaseAgent) LogInfo

func (ba *BaseAgent) LogInfo(format string, args ...interface{})

LogInfo logs an informational message with agent context.

type Wrapper

type Wrapper struct {
	*BaseAgent
	ADKAgent agent.Agent
}

Wrapper wraps common agent initialization patterns.

func NewWrapper

func NewWrapper(base *BaseAgent, adkAgent agent.Agent) *Wrapper

NewWrapper creates a wrapper with both base functionality and ADK agent.

Jump to

Keyboard shortcuts

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