Documentation
¶
Overview ¶
Package testutil provides helpers for testing applications built on agentflow.
Index ¶
- func NewTestFramework(t *testing.T, scenarioFile string, extra ...agentflow.Option) *agentflow.Framework
- func ScenarioWorkDir(scenarioFile string) (string, error)
- func WiringOptions(scenario core.Scenario, config WiringConfig) ([]agentflow.Option, error)
- type NoopTool
- type StaticGateway
- type StructuredGateway
- type WiringConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTestFramework ¶
func NewTestFramework(t *testing.T, scenarioFile string, extra ...agentflow.Option) *agentflow.Framework
NewTestFramework builds a Framework with test wiring for a scenario file.
func ScenarioWorkDir ¶ added in v0.1.8
ScenarioWorkDir returns the directory containing a scenario file, or the current working directory when the path is empty.
func WiringOptions ¶ added in v0.1.8
WiringOptions registers a mock LLM gateway and built-in demo tool executors declared in a scenario. Use in tests and examples only; production embedders should register real gateways and executors explicitly.
Types ¶
type NoopTool ¶
type NoopTool struct{}
NoopTool is a tool executor that returns an empty successful result.
type StaticGateway ¶
type StaticGateway struct {
Content string
}
StaticGateway returns a fixed assistant message for every chat request.
func (StaticGateway) Chat ¶
func (g StaticGateway) Chat(_ context.Context, _ string, _ llm.ChatRequest) (llm.ChatResponse, error)
func (StaticGateway) Supports ¶
func (g StaticGateway) Supports(string, llm.Capability) bool
type StructuredGateway ¶
type StructuredGateway struct {
Payload json.RawMessage
}
StructuredGateway returns a fixed structured payload for every structured chat request.
func (StructuredGateway) StructuredChat ¶
func (g StructuredGateway) StructuredChat(_ context.Context, _ string, _ json.RawMessage, _ llm.ChatRequest) (json.RawMessage, error)
func (StructuredGateway) Supports ¶
func (g StructuredGateway) Supports(string, llm.Capability) bool
type WiringConfig ¶ added in v0.1.8
type WiringConfig struct {
// WorkDir is the default git allowlist root and relative repo path base.
WorkDir string
// GitRoots overrides git allowlist roots; WorkDir is used when empty.
GitRoots []string
}
WiringConfig controls test and example wiring for scenarios loaded from YAML.