Skip to main content

Natural Language Condition (AI Condition)

Overview​

The Natural Language Condition (also referred to as AI Condition) can be used to assign your automation package with a ticket classification that is used in your ticketing system. The ticket classification is specified in the format of Type|Subtype|Item.

One of the example scenarios where this condition is currently being used in Pia is when suggesting packages for a user. If the Type, Subtype and Classification for the ticket matches the Ticket classification defined in the condition, Pia will suggest the package in the chatbot.

The Natural Language Condition can be selected in the Conditions menu of the Package Editor:

Below is a basic example of a package that uses Natural Language Condition:

# Pia Automation Package
conditions:
- name: 'client_filter'
optMode: 'OptOut'
category: 'Hello World'

- name: 'chat'
option_button: 'Natural Language'
option_text: 'Text which is displayed in the Pia Chatbot'
option_category: 'Pia Chatbot Category'

- name: 'ai'

steps:
- task: inline_powershell
inputs:
score: =ai.ticket_class_score
result: =ai.ticket_class_result
script: |
$percentagescore = $score * 100
$roundedscore = [math]::Round($percentagescore)
$output = "Pia is $roundedscore% certain that this ticket is $result"
return @{output = $output}

- task: chat_interaction
inputs:
text: =inline_powershell.output

In the above package, Pia will display a chat output with the ticket classification and the confidence score as shown below:

Condition Behavior​

The primary behavior of the Natural Language Condition is to allocate a ticket classification to your automation which will be used by Pia to determine when the package will be triggered for execution or suggested as an option in the Pia chatbot of your ticketing system. When a package has this condition, Pia uses a Machine Learning model to predict if the ticket detail matches the given ticket classification.

The properties of the Natural Language condition can be used to set the minimum threshold level for package execution or package suggestion so that when a ticket details match within the specified threshold level, the package will be automatically executed or suggested.

Input Properties​

Use properties to modify the behavior of the condition.

Property Name: ticket_class
Property Required: No
Property Description: Look at the ticket classification model > data tab to get the classification options. Classifications should be formatted as TYPE|SUBTYPE|ITEM

Property Name: ticket_class_threshold_action
Property Required: No
Property Description: If the threshold is greater than the supplied value, Pia will automatically run this package when it detects a ticket matching the given ticket class
Property Option: A value between 0 and 1

Property Name: ticket_class_threshold_suggest
Property Required: No
Property Description: If the threshold is greater than the supplied value, Pia will suggest this package in pia when it detects a ticket matching the given ticket class
Property Option: A value between 0 and 1

Output Properties​

Here are the output properties which the Natural Language condition makes available.

Property Name: package_started_by_ai
Property Description: If the package was started via the AI condition, this should return true. Otherwise it should return false
Property Values: 'True' or 'False'

Property Name: ticket_class_result
Property Description: The predicted ticket classification in the format Type|SubType|Item

Property Name: ticket_class_score
Property Description: The predicted ticket classification score, a number between 0 and 1

Property Name: package_options
Property Description: A comma-separated list of internal package ids available to the client that match the ai_classification