Skip to main content

Module prompt_router

Module prompt_router 

Source
Expand description

Route prompts to different handlers based on content and intent.

Rules are evaluated in descending priority order; the first matching rule determines the RouteTarget. If no rule matches, a built-in default rule that always routes to DirectModel("default") is used.

Structs§

PromptRouter
Routes prompts to targets by evaluating a sorted list of RoutingRules.
PromptRouterBuilder
Fluent builder for PromptRouter.
RoutingDecision
The result of routing a prompt.
RoutingRule
A single routing rule with priority and conditions.

Enums§

RouteTarget
Where a matched prompt should be sent.
RoutingCondition
A condition that can be tested against a prompt string and optional intent.

Functions§

evaluate_condition
Evaluate a single condition; returns (matched, description).