EXTRACT and CALL implementations
EXTRACT and CALL implementations
Address (address)
Extracts the longest possible address entity from utterance.
Currently supported languages: [‘cs’, ‘sk’, ‘hu’, ‘en’]
Description: Extracts the longest possible address entity from utterance. Returns address as a dictionary with keys: street, city and zipcode. If key has no value, it won’t be returned as part of the ouput dictionary. If no value is extracted, it returns None.
Raises : * ValueError if there is an invalid parameter of language
, parameter has to be ‘cs’ or ‘sk’
KeyError if missing required parameter
language
YAML usage:
Output:
Address (advanced_address)
Extracts the longest possible address entity from utterance.
Currently supported languages: [‘cs’, ‘sk’]
Description: Extracts the address entity consisted of Street, Street Number, Zipcode, City. Extracts exactly one address, in case of multiple present it returns first found one. Multi address extraction not supported yet. Supports returning anonymized input utterance instead of found address in case relevant argument is set.
Args:
Output:
Advanced number (advanced_number)
Return number from utterance according to the criteria.
Currently supported languages: Any
Description: Return number from utterance if it matches criteria and return it as string to support leading zeros. If no value is found, return None.
Rules: : * if user says hello 1 2 3 10 20 1
, function extracts 12310201
if user says a group of numbers delimited by letters, e.g.
num 1 2 3 and 4
it tries both123
and4
it tries to join 20/30/40/50/60/70/80/90/100 with following single digit X into 2X, 3X, e.g.
10 2 20 2 100 2
to10 2 22 100 2
and also10 2 20 2 102
if there are more group of numbers or more possibilities how to join a group of numbers, function returns just the first extracted interpretation
YAML usage:
EXTRACT: : - first_number: [advanced_number, {“min_digits”: 8, “max_digits”: 8, “pattern”: “.*1.*”}] # “number 1 2 3 13, and 1, 2 1” => extracts 12313121 (exactly 8 digits containing number 1)
Args:
Output:
anonymize (anonymize)
Anonymizer.
Currently supported languages: [‘cs’, ‘sk’, ‘hu’]
Description: Tries to remove identifiers from utterance. So far supports full_name, phone and address
YAML usage:: : CALL: : - anon: [ anonymize, { ‘custom_input’: “Ja som Michal Jurco Ok? Kozi 12a, Nová Ves, 602 00 a 735666456”, anonymizers: [ ‘full_name’, ‘phone’, ‘address’ ] } ]
Args:
Output:
bad words (bad_words)
Return sanitized input with removed explicit words.
Currently supported languages: [‘cs’]
Description: Takes in a string and tries to replace swear words with * or functional_replacement*.
YAML usage:
EXTRACT: : - cleaned_utterance: bad_words # “jsi debil a je to na hovno” => returns “jsi * a je to k ničemu”
Output:
birth_number (birth_number)
Return list of birth numbers.
Currently supported languages: [‘cs’, ‘pl’, ‘sk’, ‘ro’]
Description: Return list of valid birth/national id numbers for Slovakia, Czech republic, Poland and Romania if any contained within utterance.
YAML usage:
EXTRACT: : - user_birth_number: birth_number # “number 72223145778” => extracts 72223145778 sumcheck as per pl government site
Output:
birth_number_decomposition (birth_number_decomposition)
Return dictionary of decomposed birth number into year, month and day.
Currently supported languages: [‘cs’, ‘sk’]
Description: Return dictionary of decomposed birthdate part of valid Czech or Slovak birth number into year, month and day.
YAML usage:
EXTRACT: : - birth_number_decomposed: birth_number_decomposition # “736028/5163” => {“year”: “1973”, “month”: “10”, “day”: “28”, “valid”: “True”} # “7162060000” => {“year”: “1971”, “month”: “12”, “day”: “06”, ‘valid’: ‘False’} # “number 997/267” => returns dictionary {“year”: “”, “month”: “”, “day”: “”, “valid”: “False”} if not valid birth num
Output:
BirthDate (birthdate)
Try to guess date provided by user. Supports single precise events for now.
Currently supported languages: [‘cs’, ‘de’, ‘pl’, ‘sk’, ‘ro’]
Description: Try to guess full date from user utterance.
Return datetime in ISO format (e.g. 2020-06-13).
YAML usage:
Output:
censor (censor)
Extract vulgarisms from the last utterance.
Currently supported languages: [‘sk’, ‘cs’]
Description: Return input text with detected vulgar expressions censored out, else as is if none found.
YAML usage:
Args:
Output:
check_variant_one_to_six (check_variant_one_to_six)
Detect if numeral 1 to 6 is contained within last utterance.
Currently supported languages: [‘cs’, ‘en’, ‘sk’]
Description: Return True if variant numeral/digit 1-6 present in utterance uttered (e.g. ‘je to to prvni’, ‘2’) else None.
YAML usage:
Output:
city
city_extract_replace (city_extract_replace)
Extract name of a city from the last utterance in nominative.
Currently supported languages: [‘cs’, ‘sk’, ‘hu’, ‘en’]
Description: Return city name in Nominative if contained within the last utterance (e.g. ‘Praha’, ‘Žilina’) else None.
YAML usage:
Args:
Output:
city_street_to_postcode (city_street_to_postcode)
Extract the cities and streets from the last utterance postcodes.
Currently supported languages: [‘cs’, ‘sk’]
Description: Extract all cities and streets from the utterance and return their postcodes.
Args:
Output:
city_to_postcode (city_to_postcode)
Extract the zipcodes from the last utterance.
Currently supported languages: [‘cs’, ‘sk’, ‘hu’]
Description: Tries to map a city name to zipcodes from custom data. City name should be mentioned in the input utterance.
Returns the zipcodes in format of a list (e.g. [‘10000’, ‘25226’]).
YAML usage:
Args:
Output:
company (company)
Extract company names from the last utterance.
Currently supported languages: [‘sk’]
Description: Return company name if contained within the last utterance (e.g. [‘MalibuSK’, ‘EuroEye’]) else None if not found.
YAML usage:
Output:
cosine_similarity (cosine_similarity)
Vectorize and compare two string.
Currently supported languages: Any
Description: Transform input strings into vectors and calculate cosine similarity. Extension does one to one or one to many cosine similarity calculation. First letters of words have bigger weight for multi-word strings. Works better with equally long strings. If multiple comparison string provided, we sort by highest score, descending.
YAML usage:
Args:
Output:
counter (counter)
Extract count of visits for a specific node.
Currently supported languages: Any
Description: Return count of visit for node, where we call this extractor (e.g. node CNT_NODE countains counter, on first visit we get integer type with value of 1, every visit adds one to the returned value).
YAML usage:
Args:
Output:
current_conversation_id (current_conversation_id)
Extract conversation id.
Currently supported languages: Any
Description: Extract conversation id from goodbot.
Return conversation id (e.g. ‘text_12345’).
YAML usage:
Output:
current_date (current_date)
Return datetime.date object for checking current dates in conditions.
Currently supported languages: Any
Description: Return datetime.date object with current day date (e.g. datetime.date(2020, 9, 29)). Default timezone=’Europe/Prague’.
YAML usage:
Output:
current_named_entities (current_named_entities)
Extract current conversation named entities.
Currently supported languages: Any
Description: Return dictionary containing named entities from history object of the conversation (e.g. {‘cid’: ‘text_123’, ‘customer_id’: ‘123456’}).
YAML usage:
Output:
current_state (current_state)
Extract current state code.
Currently supported languages: Any
Description: Checks conversation history and returns current state code.
YAML usage:
EXTRACT: : - current_node: current_state # “INTENT_02_01_DIRECT_ME_TO_A_PERSON”
Output:
current_time (current_time)
Return datetime.now() object for checking current times in conditions.
Currently supported languages: Any
Description: Return datetime.now() object with current time and date (e.g. datetime.date(2020, 9, 29)). Default timezone=’Europe/Prague’.
YAML usage:
Output:
current_utc_time_millis (current_utc_time_millis)
Return datetime.now() object for checking current times in conditions.
Currently supported languages: Any
Description: Extract datetime.datetime.utcnow() in iso format as a string with current time in milliseconds (e.g. ‘2020-09-29T12:51:02.435Z’).
YAML usage:
Output:
date (date)
Try to guess date intended by user. Supports single precise events for now.
Currently supported languages: [‘cs’, ‘sk’, ‘pl’, ‘de’, ‘ro’, ‘en’, ‘nl’, ‘fr’, ‘hu’]
Description: Try to guess date from user utterance. Return date in ISO format (e.g. 2020-06-13).
If multiple date information are present, they can get mixed. Currently, intervals, fuzzy dates and other advanced features are not supported.
You can use simple relative terms like “tomorrow”, “yesterday”, etc.
Currently, only Czech, Slovak, German, Polish, English and Romanian languages are supported.
YAML usage:
Args:
Output:
dateandtime (dateandtime)
Try to guess date and time intended by user. Supports single precise events for now.
Currently supported languages: [‘cs’, ‘sk’, ‘pl’]
Description: Try to guess date and time from user utterance.
Return datetime in ISO format (e.g. 2020-06-13T18:00:00+02:00).
If multiple date/time information are present, they can get mixed. Currently, intervals, fuzzy dates and other advanced features are not supported.
You can use simple relative terms like “tomorrow”, “yesterday”, “in six hours”, “at half past five”, etc.
Currently, only Czech, Slovak and Polish languages is supported.
YAML usage:
Args:
Output:
declined_streets_to_cities (declined_streets_to_cities)
Extract the street name and street number from the last utterance.
Currently supported languages: [‘sk’, ‘cs’]
Description: Extract the city name based on street utterance.
Args:
Output:
decode_byte64 (decode_byte64)
Returns dictionary of generated filename, and its respective bytes.
Currently supported languages: Any
Description: Returns dictionary of generated filename, and its respective bytes. Expects list of strings, which are b64 encoded bytes. Correct input format of strings in list is output of current image widget implementation:
data:{data_type}/{file_suffix};base64,{base64encoded_bytes}
We should only use as callable to generate input for other functions and extensions. Bytes are not json serializable and will fail to save via SET or CALL.
YAML usage:
Output:
detect_month (detect_month)
If month mentioned by word, return the numeric order of it as a string.
Currently supported languages: [‘cs’, ‘sk’, ‘de’]
Description: Transform name of month mentioned into a number.
Return month as numeric string (e.g. 1 for january).
YAML usage:
Output:
digit_to_word (digit_to_word)
Transcribe digits into readable numerals divided into groups up to 99.
Currently supported languages: [‘cs’, ‘sk’]
Description: Return digit transcribed into words if digit is valid pure digit string or integer.
YAML usage:
Args:
Output:
distance_city_to_city (distance_city_to_city)
Calculate distance between two cities.
Currently supported languages: [‘cs’, ‘sk’]
Description: Return distance in kilometres if correct cities provided else None.
YAML usage:
Args:
Output:
encode_byte64 (encode_byte64)
Returns b64 string.
Currently supported languages: Any
Description: Returns base64 string from input bytes. Expects bytes of a file.
YAML usage:
Output:
environ (environ)
Extract whitelisted environment variable.
Currently supported languages: Any
Description: Extract whitelisted system environment variable from goodbot instance or get all whitelisted.
Return value of system environment variable (e.g. environ(“GOODBOT_PORT”) -> “8001”).
YAML usage:
Output:
Fetch Url (fetch_url)
Call external link using given method and data and return the response.
Currently supported languages: Any
Description: Call REST request to given url using method and returns JSON converted to Python objects or text if JSON response is not available. We support only the standard HTTP methods listed in ARGS.
YAML usage: : CALL: !!omap : - RESULT: [ : fetch_url, {‘url’: “www.api_waiting_for_request.com/get_data”, json_body: { id: “{id}” }} ] - ASYNC_RESULT: [ : fetch_url, {‘url’: “www.api_waiting_for_request.com/get_data”, json_body: { id: “{id}” }, non_blocking: True} ] # use non_blocking, if you do not need to wait for response, result will be saved in history at the beginning of next interaction after results received - “facts”: [ > fetch_url, > {‘url’: “https://catfacts/facts”, ‘method’: ‘GET’, ‘delay’: 5} ] # use delay, if you want to block the conversation and delay sending request by X seconds # if non_blocking is set to True, delay is ignored CALL: !!omap : - cid: current_conversation_id - history: [ : fetch_url, {‘url’: “http://goodbot:8121/conversations/{cid}/messages”, ‘method’: ‘GET’, verify: False} ]
Args:
Output:
first_email (first_email)
Extract first email address from the last utterance.
Currently supported languages: Any
Description: Extract email address if contained within last utterance uttered.
Return email address extracted from utterance (e.g. ‘meno@gmail.com’, ‘slayer@doom.au’).
YAML usage:
Output:
full_name (full_name)
Extract full name from the last utterance.
Currently supported languages: [‘cs’, ‘sk’, ‘pl’, ‘de’, ‘en’, ‘ro’, ‘hu’]
Description: Extracts the longest person entity (Dict[str, str]: {name: value, surname: value}) from raw uncorrected utterance, if that fails and argument retry_on_fail was passed as True we retry on corrected utterance.
Returns None if no entity detected as per input parameters.
YAML usage:
Output:
full_name_and_gender (full_name_and_gender)
Extract full name and its gender from the last utterance.
Currently supported languages: [‘cs’, ‘sk’, ‘pl’, ‘de’, ‘en’, ‘hu’]
Description: Extract full name extracted from utterance and gender if the name is in dictionary with (fe)males’ names. (e.g. {“name”: “Andrej”, “surname”: “Novák”, “gender”: “pán”}, {“name”: “Jana”, “surname”: “Kolárová”, “gender”: “pani”}).
YAML usage:
Output:
full_name_extract_replace (full_name_extract_replace)
Extract full name in Nominative from the last utterance.
Currently supported languages: [‘pl’]
Description: Extract full name if contained within last utterance uttered and return it in Nominative. (e.g. {“name”: “Robert”, “surname”: “Lewandowski”}, {“name”: “Jerzy”, “surname”: “Dudek”}). Supported languages: ‘pl’
YAML usage:: : CALL: : - name: full_name_extract_replace # returns the full name in Nominative from the last utterance # “chcesz rozmawiać z Robertem Lewandowskim” => {“name”: “Robert”, “surname”: “Lewandowski”} - name: [full_name, {“complete”: False}] # returns all names in Nominative from the last utterance # “z Robertem albo Jerzym Lewandowskim?” => {“name”: [“Robert”, “Jerzy”], “surname”: [“Lewandowski”]}
Output:
full_name_from_input_data (full_name_from_input_data)
Extract full name and optionally its gender from utterance using User Data Table.
Currently supported languages: [‘cs’, ‘sk’, ‘pl’, ‘de’, ‘en’, ‘nl’, ‘fr’, ‘ro’]
Description: Extract the longest full name extracted from utterance using Input Data Table. (e.g. {“name”: “Andrej”, “surname”: “Novák”, “gender”: “pán”}, {“name”: “Jana”, “surname”: “Kolárová”, “gender”: “pani”}).
YAML usage:
Output:
get_closest_work_day (get_closest_work_day)
Return iso-format date of the closest workday (Holidays extension marks it).
Currently supported languages: Any
Description: Return iso-format date equal to the closest work day (Holidays extension marks it as such).
YAML usage:
Output:
get_conversation_as_html (get_conversation_as_html)
Returns structured summary of conversation as html string.
Currently supported languages: Any
Description: YAML usage:
Output:
get_conversation_recording (get_conversation_recording)
Returns recording data of current conversation in WAV format.
Currently supported languages: Any
Description: Returns recording data of current conversation in WAV format.
YAML usage:: : content_bytes_encoded: ‘encode_byte64(get_conversation_recording(conversation_id=cid_variable, sip_host=sip_host_variable))’
Output:
get_edit_distance (get_edit_distance)
Calculate linguistically informed edit distance of two string.
Currently supported languages: Any
Description: Take two strings and calculate edit distance from first to second. Extension does one to one or one to many distance calculation. Our implementation is based on the Levenshtein distance algorithm,
however we use a custom heuristic of linguistic similarity as well as alternative distance metrics.
It is possible to change edit distance mode to CER which is better at handling multicharacter substitutions.
Works better with similarly long strings. If multiple comparison string provided, we sort by highest score, descending.
YAML usage:
CALL: : - edit_distance: : [ : get_edit_distance, { ‘string_1’: ‘love’, ‘string_2’: ‘lowe’ } ]
0.75
edit_distances:
[ : get_edit_distance, {
‘string_1’: ‘love’, ‘string_2’: [ ‘loe’, ‘Love’, ‘lowe’ ]
}
]
[[‘loe’, 2.0], [‘lowe’, 0.75], [‘Love’, 0.25]]
Args:
Output:
get_out_calls (get_out_calls)
Return list of current out calls made by input phone number.
Currently supported languages: [‘cs’, ‘sk’, ‘pl’, ‘de’, ‘hr’, ‘en’, ‘ro’, ‘ru’, ‘pt’]
Description: Return list of current out-calls made by input phone number.
YAML usage:
EXTRACT: : - first_number: [get_out_calls, {“phone_number”: +420774072329}] # [ # { # “status”: “declined”, # “trials”: 1, # “_id”: “5fd365228c0bdf00131f1888”, # “phoneNumber”: “+420725939689”, # “metaData”: { # “greeting”: “Dobrý den, u telefonu Jakub.”, # “offerid”: 312376, # }, # “calledAt”: “2020-12-11T12:25:06.341Z”, # “finishedAt”: “2020-12-11T12:25:17.895Z”, # “callListId”: “5fd364e88c0bdf00131f1884” # }, # ]
Args:
Output:
get_string_hash (get_string_hash)
Return hash for string input.
Currently supported languages: Any
Description: Return hash string for string input
YAML usage:
Output:
get_utterance_score (get_utterance_score)
Returns potential candidates for intents with their score.
Currently supported languages: Any
Description: Recover winning intent and score of last recognized utterance from conversation history.
Return pair of winning INTENTS (in language model there can be multiple identical intents) and their winning SCORE (e.g. [[‘I_CHANGE_PARAMS_FIND_DETAIL_DAY_LIMIT’, ‘I_CHANGE_PARAMS_DAY_LIMIT’], 0.9999368190765381]).
YAML usage:
Output:
GPT Prompt (gpt_prompt)
Call GPT-engine with a prompt and user’s text and return GPT’s reply.
Currently supported languages: Any
Description: Makes an HTTP request to .env-configured GPT_ENGINE_URL and returns GPT’s response.
YAML usage: : CALL: !!omap : - cid: current_conversation_id - history: [ : gpt_prompt, { system_message: ‘’, first_message: ‘’ } ]
Args:
Output:
GPT Stream (gpt_stream)
Call Open AI API with a prompt and user’s text and return GPT’s reply. Context from indexer can also be provided and the reply can be streamed in sentences to the provided URL.
Currently supported languages: Any
Description: Makes a request to Open AI API and streams GPT’s response to the provided url.
YAML usage: : CALL: : - cid: current_conversation_id - history: [ : gpt_stream, { system_message: ‘’, first_message: ‘’ } ]
Args:
Output:
holidays (holidays)
Check if current day a holiday.
Currently supported languages: [‘sk’, ‘cs’, ‘pl’, ‘de’]
Description: Return boolean value True if the date is a holiday/weekend, else False for a working day.
YAML usage:
Output:
ico (ico)
Extract company identification number from the last utterance.
Currently supported languages: [‘cs’, ‘pl’, ‘sk’]
Description: Extract czech and slovak and polish company identification number if contained within last utterance.
Return company identification number extracted from utterance (e.g. ‘15547400’, ‘47114983’).
YAML usage:
Output:
is_open_input_data (is_open_input_data)
Checks if current time within time range of set working hours.
Currently supported languages: Any
Description: Extension to enable checking working hours in client data. User needs to know table name and project name.
YAML usage:: : CALL: : - working_hours_output: [ : is_open_input_data, {
“table_name”: “Opening_hours”, “lookup_row_name”: “Apple”, “lookup_column_name”: “Project” “open_hours_column”: “Open hours”
}
]
‘Ste teraz otvoreny?’ [current time: Mo 15:15 opening hours in customer data: Tu-Fr 23:00-23:30] => “[False, []]”
‘Ste teraz otvoreny?’ [current time: Mo 15:15 opening hours in customer data: Mo-Th 13:00-23:30] => “[True, [‘13:00-23:30’]]”
‘Ste teraz otvoreny?’ [current time: Mo 15:15 opening hours in customer data: Mo-Fr 17:00-22:00] => “[False, [‘17:00-22:00’]]”
Output:
keywords (keywords)
Returns keyword from a preset list or stem dictionary if mentioned in utterance.
Currently supported languages: Any
Description: Extract a keyword as a string from utterance.
YAML usage:
Args:
Output:
No digits (no_digits)
If there is no number in utterance, returns True.
Currently supported languages: Any
Description: Returns True if there is no number (as digits or as text) in utterance (and preprocessed utterance). Otherwise, returns None.
Language dependency is hidden in preprocessed_utterance_tokens
(some text numbers can be transformed into digital form, e.g. “one” => “1”).
YAML usage:
Output:
official_street_and_number (official_street_and_number)
Extract the street name and street number from the last utterance.
Currently supported languages: [‘cs’, ‘sk’]
Description: Extract the street name and street number from utterance.
Return the street name and street number extracted from utterance (e.g. ‘Sokolova 113/3b’, ‘Husova 5’).
YAML usage:
Args:
Output:
parcel_number (parcel_number)
Extract all parcel numbers from the last utterance.
Currently supported languages: [‘cs’, ‘sk’]
Description: Extract parcel number from utterance.
Return all parcel numbers from utterance (e.g. ‘1518/3’, ‘702/49’).
YAML usage:
Output:
phone (phone)
Extract phone number from the last utterance.
Currently supported languages: [‘cs’, ‘sk’, ‘pl’, ‘de’, ‘hr’, ‘en’, ‘ro’, ‘ru’, ‘pt’]
Description: Extract phone number from utterance (e.g. ‘+421904134666’, ‘+420954260200’).
YAML usage:
Args:
Output:
postcode_to_city (postcode_to_city)
Extract the cities from the last utterance postcodes.
Currently supported languages: [‘sk’, ‘cs’]
Description: Extract all cities from the utterance and return their postcodes.
Args:
Output:
preprocessed_utterance (preprocessed_utterance)
Extract last user utterance from utterance tokens.
Currently supported languages: Any
Description: Extract last utterance uttered.
Return last utterance uttered (e.g. ‘ano’, ‘ne’, ‘veta od uzivatele’).
YAML usage:
Output:
previous_conversations (previous_conversations)
Returns data of previous conversations of the user.
Currently supported languages: Any
Description: Look for previous conversations containing specific user.
By default, returning count of previous conversation (integer number).
If verbose argument set to True, returns list of previous conversations:
Empty list or zero if none found.
YAML usage:
Args:
Output:
pronounce_job (pronounce_job)
Return pronunciation of a word passed in ‘job_name’ argument.
Currently supported languages: [‘cs’]
Description: Return phonetic pronunciation of a word passed as an argument ‘job_name’ (e.g. ‘majkrosoft’, ‘dejtabejs’).
YAML usage:
Args:
Output:
pronounce_number (pronounce_number)
Return slower pronunciation of a number using commas.
Currently supported languages: Any
Description: Transform digits to digits separated by commas for slower reading by text2speech system.
YAML usage:
Args:
Output:
quick_string_matching (quick_string_matching)
Match string to a list of predefined entities using fuzzy matching.
Currently supported languages: Any
Description: Efficient fuzzy matching tool based on tf-idf ngram vectors.
Args:
Output:
random_int (random_int)
Generate random integer number.
Currently supported languages: Any
Description: Generates a random integer N such that start <= N <= stop and returns it (e.g. 15, 42).
YAML usage:
Args:
Output:
Regex matching (regex_match)
Define a regular expression, flags and whether to succeed on presence/absence of regex.
Currently supported languages: Any
Description: Apply regular expression defined in field regex_str
on user utterance and:
return True if regular expression matches user utterance and
inverse
isFalse
return True if regular expression doesn’t match user utterance and
inverse
isTrue
otherwise return None
Regular expression flags can be defined as list of values in flags
field, e.g. ["IGNORECASE"]
or ["IGNORECASE", "NEWLINES"]
or []
Recommended webs:
tool for regex designing: https://regex101.com/
regex examples: https://ihateregex.io/expr/credit-card/
one of many good tutorials: https://www.regular-expressions.info/tutorial.html
YAML usage:
Args:
Output:
registration_plate (registration_plate)
Extract vehicle registration number from the last utterance.
Currently supported languages: [‘cs’, ‘sk’, ‘pl’, ‘de’, ‘at’, ‘ch’, ‘ro’, ‘hu’, ‘en’]
Description: Extract cs|sk|pl|de|at|ch|ro|hu standard vehicle registration number if contained within last utterance uttered.
Return company vehicle registration number extracted from utterance (e.g. ‘4A2-3000’, ‘BB-221BS’).
YAML usage:
Output:
remove_diacritics (remove_diacritics)
Remove diacritics signs from input
Currently supported languages: Any
Description: Remove diacritics signs from input and transform accented characters into characters without diacritics
YAML usage:
Args:
Output:
reset_gpt_history (reset_gpt_history)
Resets Gpt history
Currently supported languages: Any
Description: YAML usage:
Output:
rivers (rivers)
Extract river names from the last utterance as list of strings.
Currently supported languages: [‘cs’, ‘sk’]
Description: Extract river names from utterance if present.
YAML usage:
Output:
Sanitize text (sanitize_text)
If there is html or javascript code in text, remove it and return safe text.
Currently supported languages: Any
Description: YAML usage:
Output:
selected_intent (selected_intent)
Returns dictionary containing information about last picked ACTIONS intent.
Currently supported languages: Any
Description: Returns parsed source|intent|info dictionary based on last successful ACTIONS interaction.
YAML usage:
Output:
send_email (send_email)
Sends email to given email addresses over SMTP protocol.
Currently supported languages: Any
Description: Sends email to given email addresses over SMTP protocol.
YAML usage:
Args:
Output:
Simple number (simple_number)
Merge all number information from user utterance into one number.
Currently supported languages: Any
Description: Extract one number from user utterance and return it as string to support leading zeros. If no value is found, return None:
user says “Hello 3 3 1 13, 23” and smart function extracts “3311323”
user says “Hello” and smart function extracts None
user says “I want 5 bananas” and smart function extracts “5”
user says “I want 5 apples and 3 bananas” and smart function extracts “53”
YAML usage:
Output:
Simple number list (simple_number_list)
Extract all numbers from user utterance as a list.
Currently supported languages: Any
Description: Extract all numbers from user utterance and return them as a list containing strings to support leading zeros. If numbers are separated only by space, merge them. If no value is found, return None:
user says “Hello 3 3 1 13, 23” and smart function extracts [“33113”, “23”]
user says “Hello 3, 3, 1, 13, 23” and smart function extracts [“3”, “3”, “1”, “13”, “23”]
user says “Hello” and smart function extracts None
user says “I want 5 bananas” and smart function extracts [“5”]
user says “I want 5 apples and 3 bananas” and smart function extracts [“5”, “3”]
YAML usage:
Output:
soap_extractor (soap_extractor)
Return response dict, response and request string.
Currently supported languages: Any
Description: Return result (Dict), message_sent (str), message_received (str).
YAML usage:: : It is not meant to be used in YAML, but can be called in backend calls and extension on request to send and process SOAP requests
Output:
spell_out (spell_out)
Return slower pronunciation of a string using comma with white space as delimiter.
Currently supported languages: [‘cs’, ‘sk’, ‘pl’, ‘fr’, ‘de’, ‘nl’]
Description: Transform string to characters separated by commas for slower reading by text2speech system. Output allows spelling of alphanumeric characters only, everything else will be left out [ -./
].
YAML usage:
Args:
Output:
street (street)
Extract the street name and street number from the last utterance as string.
Currently supported languages: [‘cs’, ‘sk’]
Description: Extract the street name and street number as a single string from utterance.
Return the longest possible street entity extracted from utterance (e.g. ‘Sokolova 113/3b’, ‘Husova 5’).
YAML usage:
Output:
street_trie (street_trie)
Extract the street name and street number from the last utterance as string.
Currently supported languages: [‘cs’, ‘sk’, ‘pl’, ‘hu’, ‘en’]
Description: Extract the street name and street number as a single string from utterance.
Returns the longest possible street entity extracted from utterance (e.g. ‘Sokolova 113/3b’, ‘Husova 5’). Returns the street name and street number from the last utterance as a single string
YAML usage:
Output:
time (time)
Try to guess time intended by user. Supports single precise events for now.
Currently supported languages: [‘cs’, ‘sk’, ‘pl’, ‘de’, ‘en’, ‘ro’, ‘nl’, ‘fr’, ‘hu’]
Description: Try to guess time from user utterance.
Return only time in format ‘Hours:Minutes’ if presented or None if time not presented.
Currently, intervals and other advanced features are not supported.
You can use simple relative terms like “in six hours”, “at half past five”, etc.
YAML usage:
Args:
Output:
to_date (to_date)
Return datetime.date() object for checking current dates in conditions, or saving them as numbers.
Currently supported languages: Any
Description: Return datetime.date() object with current date (e.g. datetime.date(2020, 9, 29)), based on input arguments.
YAML usage:
Output:
to_readable_date (to_readable_date)
Return readable date if possible.
Currently supported languages: [‘cs’, ‘sk’]
Description: Return readable word form of date input. Input needs to contain substring in format dd.mm.yyyy.
YAML usage:
Args:
Output:
translate (translate)
Translates the input text to the specified language using Azure Translate REST API.
Currently supported languages: [‘cs’, ‘fr’, ‘hr’, ‘hu’, ‘nl’, ‘ro’, ‘ru’, ‘sk’, ‘en’, ‘pl’, ‘de’, ‘pt’]
Description: Extractor to translate the input text using Azure Translate REST API.
Args:
Output:
update_json (update_json)
Update input json variable with new dictionary input
Currently supported languages: Any
Description: Update variable equal to json structure by merging with new dictionary value and return it on output.
YAML usage:: : # in history there exists variable named some_json_variable with value {key2: value2} CALL:
updated_dictionary_variation: [ : update_json, {‘json_variable_name’: ‘some_json_variable’, ‘values’:[{“data”: “35”}, {“data_2”: {“data_3”: 40}}]}
]
for some_json_variable equal to {“data”: “30”} returns {‘data’: ‘35’, ‘data_2’: {‘data_3’: 40}}
Args:
Output:
user_data_management (user_data_management)
SELECT data from clients database.
Currently supported languages: Any
Description: Extension to enable checking custom client data. User needs to know table structure and column types. If table name is variable it needs to be defined in SET section of start node of flow. Schema is organization id.
YAML usage::
CALL: : - output: [ : user_data_management, {
“table_name”: “org_table”, “input_column”: {“age”: “30”, “shoe_size”: “11”}, “output_columns”: [“name”, “surname”, “age”]
}]
output2: [ : user_data_management, {
“table_name”: “org_table”, “ignore_case”: true, “input_column”: {“name”: “{name_variable}”, “surname”: “{surname_variable}”}, “output_columns”: [“name”, “surname”, “age”] }
]
use placeholder signifier {variable_that_contains_valid_value}, in case of input stored in variable
async_output: [
user_data_management, {
“table_name”: “org_table”, “ignore_case”: true, “input_column”: {“name”: “timo”, “surname”: “JURCO”}, “output_columns”: [“name”, “surname”, “age”], “non_blocking”: True }
]
use non_blocking, if you do not need to wait for response, result will be saved in history at the beginning of next interaction after results received: - multi_table_output: - user_data_management - table_name:[ ‘people’, ‘people2’]
input_column: : [ : [ : { “number”: ‘{input_number_1}’, “name”: ‘{input_name_1}’ }, { “number”: ‘{input_number_2}’, “name”: ‘{input_name_2}’ } ], { “number”: ‘{input_number_2}’, “name”: ‘{input_name_2}’ } ]
output_columns: [[‘number’, ‘name’, ‘surname’, ‘email’], [‘number’, ‘name’, ‘surname’]]
Output:
utterance (utterance)
Extract last user utterance from conversation.
Currently supported languages: Any
Description: Extract last utterance uttered.
Return last utterance uttered (e.g. ‘ano’, ‘ne’, ‘veta od uzivatele’).
YAML usage:
Output:
utterance_language (utterance_language)
Return string marking language of last utterance.
Currently supported languages: Any
Description: Return guess of language for utterance.
YAML usage:
Args:
Output:
winning_intent (winning_intent)
Returns if target state is intent with greatest score and above threshold.
Currently supported languages: Any
Description: Send request to the intent resolver to check winning intent against target conversation state.
Return True or None based on winning INTENTS, True if target state in winning intents (in language model there can be multiple identical intents) and their winning SCORE greater than input. (e.g. True for target I_CHANGE_PARAMS_FIND_DETAIL_DAY_LIMIT, threshold 0.8 and [[‘I_CHANGE_PARAMS_FIND_DETAIL_DAY_LIMIT’, ‘I_CHANGE_PARAMS_DAY_LIMIT’], 0.9999368190765381]).
YAML usage:
Args:
Output:
zipcode (zipcode)
Extract zipcode from the last utterance.
Currently supported languages: [‘cs’, ‘sk’, ‘pl’]
Description: Extract zipcode number from utterance.
Return zipcode number from utterance (e.g. ‘81106’, ‘60200’).
YAML usage:
Output:
zipcode (zipcode_greedy)
Extract zipcode from the last utterance.
Currently supported languages: [‘cs’, ‘sk’, ‘pl’, ‘hu’, ‘en’]
Description: Extract zipcode number from utterance, not dependent on the format.
Return zipcode number from utterance (e.g. ‘81106’, ‘60200’).
YAML usage:
Output:
widget_announcement (widget_announcement)
Returns data for the announcement widget
Currently supported languages: Any
Description: Fetches, evaluates and returns data for the announcement widget. See https://dev.azure.com/borndigitalai/Born%20Digital/_workitems/edit/1789
Args:
Output:
Last updated