Routing variants with Rules Engine
Learn about the Orq.ai business rule engine and how to perform experimentation using business rules.
Once you have set up a Deployment , orq.ai lets you route calls to your desired language models with deep customization and control.
In this document, we will dive into the Routing Functionalities and how the Business Rules Engine can be used to fit to your use-cases.
Viewing Routing Configuration
Within the Routing panel, you can configure the contexts and conditions for which a variant will be reached by your users.
A Variant represents a version of a language model configured for your deployment, it can have its unique model configuration, prompt or parameters.
The following is the visualization of the Routing configuration:
The table creates correspondance between Variants and Contexts.
Each row represents a single Variant.
Each column represents a single Context field.
Each cell represents a Value for a Context field to be matched with a Variant.
Default variant
The first row (0) of your Routing is the default variant for your deployment.
If all other rules cannot be matched, or if no context values are provided, the user will be routed to the Variant 0.
Code Snippets
You can quickly access code snippets for each of the variants in your routing table. These snippets will contain the correct context environment to reach your Variant.
To do so, simply Right-Click on the Variant you want to see code snippets for and select Generate Code Snippets, A pop-up will open containing all necessary Code Snippets for integration within your systems.
Adding a new context field
To add a new context field, press the +
button a the top right of the Routing table.
You can set a name for your field as well as type, chosen between
boolean
,date
,list
,number
, andstring
This new field can then be used to create more routing rules to fit your use case.
Routing Conditions
You can create a custom routing condition for each field, with any Variant.
To create a condition, simply enter a value in the corresponding cell.
Condition Operators
By default the =
operator will be chosen to test your condition (context value must be equal to the routing condition value).
You can change the operator by clicking on the =
symbol, then select the desired operator for your condition.
Using the Simulator to test Routing
At any time you can test your routing by opening the Simulator by selecting the Simulator Icon at the top-right of the panel.
The following modal will open:
Here you can enter values for all of the field configuration and select Simulate to see which model the query will be routed to
Updated 2 months ago