{ "name": "watsonx extension sample actions", "type": "action", "valid": true, "status": "Available", "created": "2023-07-21T23:27:18.637Z", "updated": "2023-07-21T23:31:17.833Z", "language": "en", "skill_id": "096d12a9-3b20-43ac-bc18-9d2e4c79ec1a", "workspace": { "actions": [ { "steps": [ { "step": "step_285", "output": { "generic": [ { "values": [ { "text_expression": { "concat": [ { "scalar": "Which model do you want to use?" } ] } } ], "response_type": "text", "selection_policy": "sequential" }, { "options": [ { "label": "google/flan-ul2", "value": { "input": { "text": "google/flan-ul2" } } }, { "label": "google/flan-t5-xxl", "value": { "input": { "text": "google/flan-t5-xxl" } } } ], "response_type": "option", "repeat_on_reprompt": true } ] }, "handlers": [ { "type": "not_found", "title": "validation_not_found_handler", "output": { "generic": [ { "values": [ { "text": "I didn't catch that. Select a valid option:" } ], "response_type": "text" } ] }, "handler": "validation_not_found_handler", "resolver": { "type": "prompt_again" }, "next_handler": "validation_not_found_max_tries_handler" }, { "type": "not_found_max_tries", "title": "validation_not_found_max_tries_handler", "handler": "validation_not_found_max_tries_handler", "resolver": { "type": "fallback" } } ], "question": { "entity": "entity_34680", "max_tries": 3 }, "resolver": { "type": "continue" }, "variable": "step_285", "next_step": "step_333" }, { "step": "step_333", "output": { "generic": [ { "values": [ { "text_expression": { "concat": [ { "scalar": "How many tokens do you want to generate?" } ] } } ], "response_type": "text", "selection_policy": "sequential", "repeat_on_reprompt": true } ] }, "context": { "variables": [] }, "handlers": [ { "type": "input_validation", "title": "input_validation_handler_1", "output": { "generic": [ { "values": [ { "text_expression": { "concat": [ { "scalar": "I didn't catch that. Enter a number between 1 to 1024" } ] } } ], "response_type": "text", "selection_policy": "incremental" } ] }, "handler": "input_validation_handler_1", "resolver": { "type": "prompt_again" }, "next_handler": "validation_not_found_handler", "input_constraints": [ { "name": "minimum", "value": { "scalar": 1 } }, { "name": "maximum", "value": { "scalar": 1024 } } ] }, { "type": "not_found", "title": "validation_not_found_handler", "output": { "generic": [ { "values": [ { "text_expression": { "concat": [ { "scalar": "I didn't catch that. Enter a number between 1 to 1024" } ] } } ], "response_type": "text", "selection_policy": "incremental" } ] }, "handler": "validation_not_found_handler", "resolver": { "type": "prompt_again" }, "next_handler": "validation_not_found_max_tries_handler" }, { "type": "not_found_max_tries", "title": "validation_not_found_max_tries_handler", "handler": "validation_not_found_max_tries_handler", "resolver": { "type": "fallback" } } ], "question": { "entity": "sys-number", "max_tries": 3 }, "resolver": { "type": "continue" }, "variable": "step_333", "next_step": "step_577" }, { "step": "step_577", "output": { "generic": [ { "values": [ { "text_expression": { "concat": [ { "scalar": "How many minimum tokens do you want to generate?" } ] } } ], "response_type": "text", "selection_policy": "sequential", "repeat_on_reprompt": false } ] }, "handlers": [ { "type": "input_validation", "title": "input_validation_handler_1", "output": { "generic": [ { "values": [ { "text_expression": { "concat": [ { "scalar": "I didn't catch that. Enter a number between 0 to 1024" } ] } } ], "response_type": "text", "selection_policy": "incremental" } ] }, "handler": "input_validation_handler_1", "resolver": { "type": "prompt_again" }, "next_handler": "validation_not_found_handler", "input_constraints": [ { "name": "maximum", "value": { "scalar": 1024 } }, { "name": "minimum", "value": { "scalar": 0 } } ] }, { "type": "not_found", "title": "validation_not_found_handler", "output": { "generic": [ { "values": [ { "text_expression": { "concat": [ { "scalar": "I didn't catch that. Enter a number between 0 to 1024" } ] } } ], "response_type": "text", "selection_policy": "incremental" } ] }, "handler": "validation_not_found_handler", "resolver": { "type": "prompt_again" }, "next_handler": "validation_not_found_max_tries_handler" }, { "type": "not_found_max_tries", "title": "validation_not_found_max_tries_handler", "handler": "validation_not_found_max_tries_handler", "resolver": { "type": "fallback" } } ], "question": { "entity": "sys-number", "max_tries": 3 }, "resolver": { "type": "continue" }, "variable": "step_577", "next_step": "step_605" }, { "step": "step_605", "output": { "generic": [ { "values": [ { "text_expression": { "concat": [ { "scalar": "What temperature do you want to use?" } ] } } ], "response_type": "text", "selection_policy": "sequential", "repeat_on_reprompt": false } ] }, "handlers": [ { "type": "input_validation", "title": "input_validation_handler_1", "output": { "generic": [ { "values": [ { "text_expression": { "concat": [ { "scalar": "I didn't catch that. Enter a number." } ] } } ], "response_type": "text", "selection_policy": "incremental" } ] }, "handler": "input_validation_handler_1", "resolver": { "type": "prompt_again" }, "next_handler": "validation_not_found_handler", "input_constraints": [ { "name": "minimum", "value": { "scalar": 0 } }, { "name": "maximum", "value": { "scalar": 1 } } ] }, { "type": "not_found", "title": "validation_not_found_handler", "output": { "generic": [ { "values": [ { "text_expression": { "concat": [ { "scalar": "I didn't catch that. Enter a number." } ] } } ], "response_type": "text", "selection_policy": "incremental" } ] }, "handler": "validation_not_found_handler", "resolver": { "type": "prompt_again" }, "next_handler": "validation_not_found_max_tries_handler" }, { "type": "not_found_max_tries", "title": "validation_not_found_max_tries_handler", "handler": "validation_not_found_max_tries_handler", "resolver": { "type": "fallback" } } ], "question": { "entity": "sys-number", "max_tries": 3 }, "resolver": { "type": "continue" }, "variable": "step_605", "next_step": "step_129" }, { "step": "step_129", "output": { "generic": [ { "values": [ { "text_expression": { "concat": [ { "scalar": "What prompt do you want to use?" } ] } } ], "response_type": "text", "selection_policy": "sequential" } ] }, "context": { "variables": [] }, "handlers": [], "question": { "free_text": true, "response_collection_behavior": "always_ask" }, "resolver": { "type": "continue" }, "variable": "step_129", "next_step": "step_817" }, { "step": "step_817", "output": { "generic": [] }, "context": { "variables": [ { "value": { "variable": "step_285" }, "skill_variable": "model_id" }, { "value": { "variable": "step_333" }, "skill_variable": "model_parameters_max_new_tokens" }, { "value": { "variable": "step_577" }, "skill_variable": "model_parameters_min_new_tokens" }, { "value": { "variable": "step_605" }, "skill_variable": "model_parameters_temperature" }, { "value": { "expression": "${step_129}" }, "skill_variable": "model_input" } ] }, "handlers": [], "resolver": { "type": "invoke_another_action", "invoke_action": { "action": "action_3200-2", "policy": "default", "parameters": null, "result_variable": "step_817_result_1" } }, "variable": "step_817", "next_step": "step_606" }, { "step": "step_606", "output": { "generic": [ { "values": [ { "text_expression": { "concat": [ { "scalar": "Response is: " }, { "skill_variable": "model_response" } ] } } ], "response_type": "text", "selection_policy": "sequential" } ] }, "context": { "variables": [] }, "handlers": [], "resolver": { "type": "end_action" }, "variable": "step_606" } ], "title": "Test model", "action": "action_3200", "boosts": [], "handlers": [], "condition": { "intent": "action_3200_intent_45093" }, "variables": [ { "title": "What prompt do you want to use?", "variable": "step_129", "data_type": "any" }, { "title": "Which model do you want to use?", "variable": "step_285", "data_type": "any" }, { "title": "How many tokens do you want to generate?", "variable": "step_333", "data_type": "number" }, { "title": "How many minimum tokens do you want to generate?", "variable": "step_577", "data_type": "number" }, { "title": "What temperature do you want to use?", "variable": "step_605", "data_type": "number" }, { "title": "Response is: {variable}", "variable": "step_606", "data_type": "any" }, { "title": "No response", "variable": "step_817", "data_type": "any" }, { "variable": "step_817_result_1", "data_type": "any" } ], "next_action": "action_3200-2", "topic_switch": { "allowed_from": true, "allowed_into": true, "never_return": false }, "disambiguation_opt_out": false }, { "steps": [ { "step": "step_817", "output": { "generic": [] }, "context": { "variables": [] }, "handlers": [], "resolver": { "type": "callout", "callout": { "path": "/ml/v1-beta/generation/text", "type": "integration_interaction", "method": "POST", "internal": { "spec_hash_id": "efd13c68dff079388ffa62bfc3aff447e49efd7024450961cc74d6de89106cce", "catalog_item_id": "f53a6acc-4505-45a5-a785-27fe357b96da" }, "request_mapping": { "body": [ { "value": { "skill_variable": "model_input" }, "parameter": "input" }, { "value": { "skill_variable": "model_id" }, "parameter": "model_id" }, { "value": { "skill_variable": "watsonx_project_id" }, "parameter": "project_id" }, { "value": { "skill_variable": "model_parameters_temperature" }, "parameter": "parameters.temperature" }, { "value": { "skill_variable": "model_parameters_max_new_tokens" }, "parameter": "parameters.max_new_tokens" }, { "value": { "skill_variable": "model_parameters_min_new_tokens" }, "parameter": "parameters.min_new_tokens" }, { "value": { "skill_variable": "model_parameters_stop_sequences" }, "parameter": "parameters.stop_sequences" }, { "value": { "skill_variable": "model_parameters_repetition_penalty" }, "parameter": "parameters.repetition_penalty" } ], "query": [ { "value": { "skill_variable": "watsonx_api_version" }, "parameter": "version" } ] }, "result_variable": "step_817_result_2" } }, "variable": "step_817", "next_step": "step_606" }, { "step": "step_606", "output": { "generic": [] }, "context": { "variables": [ { "value": { "expression": "${step_817_result_2.body.results}[0].generated_text" }, "skill_variable": "model_response" } ] }, "handlers": [], "resolver": { "type": "end_action" }, "variable": "step_606", "condition": { "and": [ { "eq": [ { "variable": "step_817_result_2", "variable_path": "success" }, { "scalar": true } ] }, { "expression": "${step_817_result_2.body.results}.size() > 0" } ] }, "next_step": "step_212" }, { "step": "step_212", "output": { "generic": [] }, "context": { "variables": [ { "value": { "expression": "null" }, "skill_variable": "model_response" } ] }, "handlers": [], "resolver": { "type": "end_action" }, "variable": "step_212" } ], "title": "Invoke watsonx Generation API", "action": "action_3200-2", "boosts": [], "handlers": [], "condition": { "intent": "action_3200_intent_45093-2" }, "variables": [ { "title": "", "variable": "step_212", "data_type": "any" }, { "title": "", "variable": "step_606", "data_type": "any" }, { "title": "No response", "variable": "step_817", "data_type": "any" }, { "variable": "step_817_result_2", "data_type": "any" } ], "next_action": "fallback", "topic_switch": { "allowed_from": true, "allowed_into": true, "never_return": false }, "disambiguation_opt_out": false }, { "steps": [ { "step": "step_001", "output": { "generic": [ { "values": [ { "text": "I'm afraid I don't understand. Please rephrase your question." } ], "response_type": "text", "selection_policy": "sequential" } ] }, "handlers": [], "resolver": { "type": "end_action" }, "variable": "step_001", "condition": { "lte": [ { "system_variable": "no_action_matches_count" }, { "scalar": 3 } ] }, "next_step": "step_002" }, { "step": "step_002", "output": { "generic": [ { "values": [ { "text": "" } ], "response_type": "text", "selection_policy": "sequential" } ] }, "handlers": [], "resolver": { "type": "invoke_another_action_and_end", "invoke_action": { "action": "fallback", "policy": "default", "parameters": null, "result_variable": "step_002_result_1" } }, "variable": "step_002", "condition": { "gt": [ { "system_variable": "no_action_matches_count" }, { "scalar": 3 } ] } } ], "title": "No action matches", "action": "anything_else", "boosts": [], "handlers": [], "condition": { "expression": "anything_else" }, "variables": [ { "title": "I am afraid I do not understand what you are asking, please re-p", "variable": "step_001", "data_type": "any" }, { "variable": "step_002", "data_type": "any" }, { "variable": "step_002_result_1", "data_type": "any" } ], "disambiguation_opt_out": true }, { "steps": [ { "step": "digression_failure", "output": { "generic": [ { "values": [ { "text": "Sorry I couldn't confirm if you wanted to return to previous topic, let me connect to an agent." } ], "response_type": "text", "selection_policy": "sequential" } ] }, "handlers": [], "resolver": { "type": "connect_to_agent", "response": { "transfer_info": { "target": {} }, "agent_available": { "message": "Let's send you to an available agent." }, "agent_unavailable": { "message": "There are no agents available at this time. When one becomes available, we'll connect you." }, "message_to_human_agent": "" } }, "variable": "digression_failure", "condition": { "eq": [ { "system_variable": "fallback_reason" }, { "scalar": "Failed to confirm topic return" } ] }, "next_step": "step_001" }, { "step": "step_001", "output": { "generic": [ { "values": [ { "text": "I'm afraid I don't understand. I can connect you to an agent." } ], "response_type": "text", "selection_policy": "sequential" } ] }, "handlers": [], "resolver": { "type": "connect_to_agent", "response": { "transfer_info": { "target": {} }, "agent_available": { "message": "Let's send you to an available agent." }, "agent_unavailable": { "message": "There are no agents available at this time. When one becomes available, we'll connect you." }, "message_to_human_agent": "" } }, "variable": "step_001", "condition": { "eq": [ { "system_variable": "fallback_reason" }, { "scalar": "Step validation failed" } ] }, "next_step": "step_002" }, { "step": "step_002", "output": { "generic": [ { "values": [ { "text": "Sorry I couldn't assist you. I will connect you to an agent right away." } ], "response_type": "text", "selection_policy": "sequential" } ] }, "handlers": [], "resolver": { "type": "connect_to_agent", "response": { "transfer_info": { "target": {} }, "agent_available": { "message": "Let's send you to an available agent." }, "agent_unavailable": { "message": "There are no agents available at this time. When one becomes available, we'll connect you." }, "message_to_human_agent": "" } }, "variable": "step_002", "condition": { "eq": [ { "system_variable": "fallback_reason" }, { "scalar": "Agent requested" } ] }, "next_step": "step_003" }, { "step": "step_003", "output": { "generic": [ { "values": [ { "text": "I am afraid I do not understand what you are asking, let me connect you to an agent." } ], "response_type": "text", "selection_policy": "sequential" } ] }, "handlers": [], "resolver": { "type": "connect_to_agent", "response": { "transfer_info": { "target": {} }, "agent_available": { "message": "Let's send you to an available agent." }, "agent_unavailable": { "message": "There are no agents available at this time. When one becomes available, we'll connect you." }, "message_to_human_agent": "" } }, "variable": "step_003", "condition": { "eq": [ { "system_variable": "fallback_reason" }, { "scalar": "No action matches" } ] }, "next_step": "step_004" }, { "step": "step_004", "output": { "generic": [ { "values": [ { "text": "It seems this conversation would be best managed by a human agent. Let me connect you to one of our agents." } ], "response_type": "text", "selection_policy": "sequential" } ] }, "handlers": [], "resolver": { "type": "connect_to_agent", "response": { "transfer_info": { "target": {} }, "agent_available": { "message": "Let's send you to an available agent." }, "agent_unavailable": { "message": "There are no agents available at this time. When one becomes available, we'll connect you." }, "message_to_human_agent": "" } }, "variable": "step_004", "condition": { "eq": [ { "system_variable": "fallback_reason" }, { "scalar": "Danger word detected" } ] }, "next_step": "step_005" }, { "step": "step_005", "output": { "generic": [ { "values": [ { "text": "It seems this conversation would be best managed by a human agent. Let me connect you to one of our agents." } ], "response_type": "text", "selection_policy": "sequential" } ] }, "handlers": [], "resolver": { "type": "connect_to_agent", "response": { "transfer_info": { "target": {} }, "agent_available": { "message": "Let's send you to an available agent." }, "agent_unavailable": { "message": "There are no agents available at this time. When one becomes available, we'll connect you." }, "message_to_human_agent": "" } }, "variable": "step_005", "condition": { "eq": [ { "system_variable": "fallback_reason" }, { "scalar": "Profanity detected" } ] } } ], "title": "Fallback", "action": "fallback", "boosts": [], "handlers": [], "condition": { "intent": "fallback_connect_to_agent" }, "variables": [ { "title": "Topic return failed", "variable": "digression_failure", "data_type": "any" }, { "title": "I'm afraid I don't understand. I can connect you to an agent.", "variable": "step_001", "data_type": "any" }, { "title": "Sorry I couldn't assist you. I will connect you to an agent righ", "variable": "step_002", "data_type": "any" }, { "title": "I am afraid I do not understand what you are asking, let me conn", "variable": "step_003", "data_type": "any" }, { "title": "It seems this conversation would be best managed", "variable": "step_004", "data_type": "any" }, { "title": "Profanity - It seems this conversation", "variable": "step_005", "data_type": "any" } ], "next_action": "run_always", "disambiguation_opt_out": true }, { "steps": [ { "step": "danger_word_detected", "title": "Connect to agent", "handlers": [], "resolver": { "type": "fallback" }, "variable": "danger_word_detected_variable", "condition": { "entity": "danger_words" }, "next_step": "profanity_detected" }, { "step": "profanity_detected", "title": "Show warning", "output": { "generic": [ { "values": [ { "text_expression": { "concat": [ { "scalar": "Please use appropriate language when interacting with the assistant." } ] } } ], "response_type": "text", "selection_policy": "sequential" } ] }, "handlers": [ { "type": "max_hits", "handler": "max_hits_handler", "resolver": { "type": "fallback" } } ], "max_hits": 2, "resolver": { "type": "end_action" }, "variable": "profanity_detected_variable", "condition": { "entity": "profane_words" } } ], "title": "Trigger word detected", "action": "run_always", "boosts": [], "handlers": [], "variables": [ { "title": "Profanity detected", "variable": "danger_word_detected_variable", "data_type": "any" }, { "title": "Profane word detected", "variable": "profanity_detected_variable", "data_type": "any" } ], "next_action": "anything_else" }, { "steps": [ { "step": "step_001", "output": { "generic": [ { "values": [ { "text": "Welcome, how can I assist you?" } ], "response_type": "text", "selection_policy": "sequential" } ] }, "handlers": [], "resolver": { "type": "end_action" }, "variable": "step_001" } ], "title": "Greet customer", "action": "welcome", "boosts": [], "handlers": [], "condition": { "expression": "welcome" }, "variables": [ { "variable": "step_001", "data_type": "any" } ], "next_action": "action_3200", "disambiguation_opt_out": true } ], "intents": [ { "intent": "action_3200_intent_45093", "examples": [ { "text": "Test model" } ] }, { "intent": "action_3200_intent_45093-2", "examples": [] }, { "intent": "fallback_connect_to_agent", "examples": [ { "text": "Agent help" }, { "text": "Call agent" }, { "text": "Can I connect to an agent?" }, { "text": "I would like to speak to a human" }, { "text": "I would like to speak to someone" } ], "description": "Please transfer me to an agent" } ], "entities": [ { "entity": "danger_words", "values": [], "fuzzy_match": false }, { "entity": "entity_34680", "values": [ { "type": "synonyms", "value": "google/flan-t5-xxl", "synonyms": ["flan-t5-xxl", "t5", "xxl"] }, { "type": "synonyms", "value": "google/flan-ul2", "synonyms": ["flan-ul2", "ul2"] } ], "fuzzy_match": true }, { "entity": "profane_words", "values": [], "fuzzy_match": false }, { "entity": "sys-number", "values": [] }, { "entity": "sys-yes-no", "values": [] } ], "metadata": { "api_version": { "major_version": "v2", "minor_version": "2021-11-27" } }, "variables": [ { "title": "model_id", "variable": "model_id", "data_type": "string", "description": "The ID of the model to be used for this request. Please refer to the list of models at https://bam.res.ibm.com/docs/models", "initial_value": { "scalar": "google/flan-ul2" } }, { "title": "model_input", "variable": "model_input", "data_type": "string", "description": "" }, { "title": "model_parameters_max_new_tokens", "variable": "model_parameters_max_new_tokens", "data_type": "number", "description": "The maximum number of new tokens to be generated.", "initial_value": { "scalar": 300 } }, { "title": "model_parameters_min_new_tokens", "variable": "model_parameters_min_new_tokens", "data_type": "number", "description": "", "initial_value": { "scalar": 1 } }, { "title": "model_parameters_repetition_penalty", "variable": "model_parameters_repetition_penalty", "data_type": "number", "description": "", "initial_value": { "scalar": 1.1 } }, { "title": "model_parameters_stop_sequences", "variable": "model_parameters_stop_sequences", "data_type": "any", "description": "", "initial_value": { "expression": "[\"\\n\\n\"]" } }, { "title": "model_parameters_temperature", "variable": "model_parameters_temperature", "data_type": "number", "description": "The value used to module the next token probabilities. The range is 0.05 to 1.00, a value set to 0.05 would make it mostly deterministic.", "initial_value": { "scalar": 0 } }, { "title": "model_response", "variable": "model_response", "data_type": "string", "description": "The text generated by the model in response to the inputs." }, { "title": "watsonx_api_version", "variable": "watsonx_api_version", "data_type": "any", "description": "", "initial_value": { "scalar": "2023-05-29" } }, { "title": "watsonx_project_id", "variable": "watsonx_project_id", "data_type": "any", "description": "" } ], "data_types": [], "collections": [], "counterexamples": [], "system_settings": { "variable": { "format": { "time": { "pattern": "short" }, "currency": { "fraction_digits": 2 } } }, "off_topic": { "enabled": true }, "topic_switch": { "enabled": true, "messages": { "enable_confirmation": true, "confirmation_failure": { "generic": [ { "values": [ { "text_expression": { "concat": [ { "scalar": "I'm sorry, I did not catch that, please confirm." } ] } } ], "response_type": "text", "selection_policy": "sequential" } ] }, "confirmation_request": { "generic": [ { "values": [ { "text_expression": { "concat": [ { "scalar": "Do you want to continue with the previous topic: " }, { "system_variable": "digressed_from" }, { "scalar": "?" } ] } } ], "response_type": "text", "selection_policy": "sequential" }, { "options": [ { "label": "Yes", "value": { "input": { "text": "Yes" } } }, { "label": "No", "value": { "input": { "text": "No" } } } ], "response_type": "option", "repeat_on_reprompt": true } ] } }, "max_tries": 3 }, "disambiguation": { "prompt": "Did you mean:", "enabled": true, "randomize": true, "max_suggestions": 5, "suggestion_text_policy": "title", "none_of_the_above_prompt": "None of the above", "use_connect_to_support_prompt": "connect to support", "single_answer_clarification_prompt": "Something else" }, "spelling_auto_correct": true }, "learning_opt_out": true }, "description": "created for assistant 05c10d7d-336f-4d33-8cb3-5c53520d61ce", "assistant_id": "69f5847f-17c6-4cb0-bafe-e1c3e5f7cfd2", "workspace_id": "096d12a9-3b20-43ac-bc18-9d2e4c79ec1a", "dialog_settings": {}, "next_snapshot_version": "1" }