agent

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentLoop

type AgentLoop struct {
	Registry       *provider.Registry
	Session        *Session
	ToolRegistry   *tools.Registry
	Approval       *tools.ApprovalGate
	ContextManager *ContextManager
}

func NewAgentLoop

func NewAgentLoop(registry *provider.Registry, session *Session, toolReg *tools.Registry, approval *tools.ApprovalGate) *AgentLoop

func (*AgentLoop) Run

func (a *AgentLoop) Run(ctx context.Context) error

type ContextManager

type ContextManager struct {
	MaxTokens int
}

func NewContextManager

func NewContextManager(maxTokens int) *ContextManager

func (*ContextManager) EstimateHistoryTokens

func (cm *ContextManager) EstimateHistoryTokens(history []provider.Message) int

func (*ContextManager) EstimateTokens

func (cm *ContextManager) EstimateTokens(msg provider.Message) int

func (*ContextManager) Truncate

func (cm *ContextManager) Truncate(history []provider.Message) []provider.Message

type Session

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

func NewSession

func NewSession(model string) *Session

func (*Session) AddMessage

func (s *Session) AddMessage(msg provider.Message)

func (*Session) Clear

func (s *Session) Clear()

func (*Session) History

func (s *Session) History() []provider.Message

func (*Session) LastAssistantMessage

func (s *Session) LastAssistantMessage() string

func (*Session) Model

func (s *Session) Model() string

func (*Session) SetModel

func (s *Session) SetModel(model string)

Jump to

Keyboard shortcuts

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