agenttest

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package agenttest provides test helpers for pi-core-agent-go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAgent

func NewAgent(t *testing.T, opts Opts) *pi.Agent

NewAgent creates an Agent with sensible test defaults and registers t.Cleanup.

func RunAndCollect

func RunAndCollect(t *testing.T, agent *pi.Agent, prompt string) ([]pi.AgentEvent, pi.PromptResult)

RunAndCollect prompts the agent, drains both channels, and returns all events + the terminal result.

Types

type Opts

type Opts struct {
	Provider     llm.LLMProvider
	Tools        []pi.RegisteredTool
	Hooks        pi.Hooks
	SystemPrompt string
	Session      pi.SessionRepo
}

Opts carries options for NewAgent.

Jump to

Keyboard shortcuts

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