Orchestration
...
Scripts
Using the Swimlane Python Chatbot
4 min
when configuring a script native action, you’ll notice an icon in the lower right corner of your browser window selecting the script native action makes the swimlane hero ai python chatbot available to assist you with python scripting think of it as your python scripting assistant it can help you generate python code for transformation logic, filtering, extraction, or any other function you need within the script action getting started with the python chatbot click the chatbot icon to open a new chat the first time you ask a question, the chatbot will prompt you to acknowledge that your organization has accepted the swimlane terms and conditions you can click swimlane terms and conditions to review them once you click acknowledge , the chatbot will be ready to assist you now you can begin formulating python scripts! capabilities of the python chatbot the goal of the swimlane python chatbot is to help you craft python scripts that operate on json objects from the script action inputs the chatbot can generate fully interoperable python scripts that align with the conventions used in swimlane it will also help you refine your script as needed example scenario python chatbot query in this example, amir wants to generate python code to filter, extract, or transform an input json object amir opens the swimlane python chatbot and types, "filter emails with malicious in a subject key" and clicks submit your question the chatbot notices that amir has not yet defined the script action’s inputs and prompts him to define a json object amir sets up a json object for emails {"subject" string, "body" string} , and then asks the chatbot the same question "filter emails with malicious in a subject key" and clicks submit your question the chatbot responds with a python script that picks up the json schema from the script action inputs and passes them as context to hero ai amir reviews the script and refines it further by asking, "additionally, filter the emails by body containing the word spam " amir then remembers that his email object also includes a malicious score he updates the email object and asks the chatbot, "instead of filtering the body, filter emails by malicious score higher than 95% " as you can see, the chatbot is interactive and allows amir to refine his script as he progresses final script generated by swimlane python chatbot