Optional Slots
Important: Optional Slots Are Not Natively Supported
Optional slots are not an officially supported feature at this time. Native support is on the roadmap for Q1 2026.
Recommendation: We strongly advise avoiding use cases with a hard requirement on optional slots until this feature is officially released.
Unsupported Workaround: The following example provides a temporary workaround. Please be aware that this method extends the behavior of our reasoning engine beyond its current capabilities and is not guaranteed to be reliable.
If you choose to implement this workaround:
You must plan to refactor this implementation once official support is available.
We cannot provide troubleshooting support for any issues that arise from its use.
Workaround: Implementing an Optional Slot
To simulate an optional slot (one that is only filled if a user provides a value, otherwise falling back to a default), you must use a specific slot configuration and description.
-
Slot Configuration
Create your slot and you have to set the Inference Policy to
Infer slot value if available. -
Slot Description
The key to this workaround is a precise Slot Description. The reasoning engine uses this description to determine how to fill the slot.
Your description must contain two instructions:
- A clear command not to prompt the user for the value.
- A specific, non-NULL fallback to use if the user provides no value.
Warning: You must provide a non-NULL fallback (e.g., "not provided"). If you instruct the reasoning engine to use NULL, it will ignore the instruction and repeatedly prompt the user, defeating the optional behavior.
-
Example: Optional Query Filter
Imagine you need an optional
device_namefilter for a query.
Slot Name: device_name
Type: string
Description:
The name of the device that the users wants to check responsiveness for. This slot is optional. If the user does not explicitly provide one then default the value to "not provided" with no quotes. Do not prompt the user for this value.
This description will, in most cases, cause the reasoning engine to fill the slot with "not provided" if the user doesn't specify a device.
- Handling the Fallback in Your Action In your plugin logic, you must check for this fallback string and add your conditional logic accordingly.
Conditionally add the filter to your action input args
filter_query:
EVAL():
args:
base_filter:
RENDER():
args:
end_time: data.end_time
start_time: data.start_time
template: general.lastContactTime=ge='{{start_time}}' and general.lastContactTime=le='{{end_time}}'
filters:
FILTER():
items:
- CONDITIONAL():
condition: data.device_name != "not provided"
on_fail: '""'
on_pass:
RENDER():
args:
devicename: data.device_name
template: general.name==*{{device_name}}*
expression: |-
IF $LENGTH(filters)>0 THEN
$CONCAT([base_filter, ";", filters.$CONCAT(";",true)])
ELSE
base_filter
Updated about 2 hours ago