Documentation
¶
Overview ¶
Package chaos provides fault injection for PromptArena resilience testing. It implements a hooks.ToolHook that intercepts tool execution and injects failures (errors, timeouts, latency) based on scenario chaos configuration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigFromContext ¶
func ConfigFromContext(ctx context.Context) *config.ChaosConfig
ConfigFromContext retrieves chaos config from the context.
func WithConfig ¶
WithConfig stores chaos config in the context.
Types ¶
type Hook ¶
type Hook struct{}
Hook implements hooks.ToolHook to inject failures into tool execution.
func (*Hook) AfterExecution ¶
func (h *Hook) AfterExecution(_ context.Context, _ hooks.ToolRequest, _ hooks.ToolResponse) hooks.Decision
AfterExecution is a no-op — always allows.
func (*Hook) BeforeExecution ¶
BeforeExecution checks chaos config and injects tool failures.
Click to show internal directories.
Click to hide internal directories.