agent

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextBuilder

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

ContextBuilder builds LLM context

func NewContextBuilder

func NewContextBuilder(workspacePath string) *ContextBuilder

NewContextBuilder creates a context builder

func (*ContextBuilder) BuildMessages

func (c *ContextBuilder) BuildMessages(history []*session.Message, current string, media []string) []*schema.Message

BuildMessages constructs the full message list

func (*ContextBuilder) BuildSystemPrompt

func (c *ContextBuilder) BuildSystemPrompt() string

BuildSystemPrompt assembles the system prompt

type Loop

type Loop struct {
	OnToolStart  func(name, args string)
	OnToolFinish func(name, result string, err error)
	// contains filtered or unexported fields
}

Loop is the main agent processing loop

func NewLoop

func NewLoop(cfg *config.Config, msgBus *bus.MessageBus, chatModel model.ChatModel) (*Loop, error)

NewLoop creates a new agent loop

func (*Loop) ProcessDirect

func (l *Loop) ProcessDirect(ctx context.Context, content string) (string, error)

ProcessDirect processes a message directly (for CLI)

func (*Loop) ProcessForChannel added in v0.1.4

func (l *Loop) ProcessForChannel(ctx context.Context, channel, chatID, senderID, content string) (string, error)

ProcessForChannel processes a message directly for a given channel/session.

func (*Loop) RegisterDefaultTools

func (l *Loop) RegisterDefaultTools(cfg *config.Config) error

RegisterDefaultTools registers all built-in tools

func (*Loop) Run

func (l *Loop) Run(ctx context.Context) error

Run starts the agent loop

Jump to

Keyboard shortcuts

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