Documentation
¶
Index ¶
- func ArenaStateStoreSaveMiddleware(config *pipeline.StateStoreConfig) pipeline.Middleware
- func HistoryInjectionMiddleware(history []types.Message) pipeline.Middleware
- func PersonaAssemblyMiddleware(persona *config.UserPersonaPack, region string, ...) pipeline.Middleware
- func ScenarioContextExtractionMiddleware(scenario *config.Scenario) pipeline.Middleware
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArenaStateStoreSaveMiddleware ¶
func ArenaStateStoreSaveMiddleware(config *pipeline.StateStoreConfig) pipeline.Middleware
ArenaStateStoreSaveMiddleware saves conversation state with telemetry to ArenaStateStore. This middleware captures validation results, turn metrics, and cost information for Arena testing and analysis.
func HistoryInjectionMiddleware ¶
func HistoryInjectionMiddleware(history []types.Message) pipeline.Middleware
HistoryInjectionMiddleware prepends conversation history to the message list. This is useful for self-play scenarios where history needs to be explicitly provided before the LLM generates the next user message.
The middleware preserves any existing messages in the ExecutionContext and prepends the provided history, maintaining chronological order.
func PersonaAssemblyMiddleware ¶
func PersonaAssemblyMiddleware( persona *config.UserPersonaPack, region string, baseVariables map[string]string, ) pipeline.Middleware
PersonaAssemblyMiddleware assembles persona prompts using the same fragment/template system as PromptAssemblyMiddleware. Populates execCtx.SystemPrompt with the persona's assembled prompt.
This middleware mirrors the behavior of PromptAssemblyMiddleware but for personas: - Uses persona's BuildSystemPrompt() which handles fragment assembly - Supports template variable substitution with {{variable}} syntax - Injects persona-specific variables (goals, constraints, style) - Sets base variables for downstream template middleware
func ScenarioContextExtractionMiddleware ¶
func ScenarioContextExtractionMiddleware(scenario *config.Scenario) pipeline.Middleware
Types ¶
This section is empty.