Generating and Analyzing Code Using AI
Automic Automation scripts can be large and complex. Understanding or writing them from scratch can be time-consuming. You can take advantage of Automic Automation's Gen AI capabilities using the Automation Assistant to analyze existing scripts, troubleshoot logic or generate entirely new code snippets using natural language prompts.
Generating Code with AI
Instead of manually coding every line, you can describe your requirements in plain language and let the Automation Assistant draft the script for you.
To Generate Code with AI
-
Open the script editor in the object you are configuring.
-
Right-click to select Ask Automation Assistant.
-
Describe what you want the script to do.
Examples:
-
Write a Python script to check the status of a network service and log the results.
-
Create a Bash script that clears all files older than 30 days from the /temp directory.
-
-
The Intelligent Assistant pane opens to the Automation Assistant and your prompt is processed. The assistant then generates and inserts the new code directly into the script editor.
-
Review the generated code. You can use the chat interface to refine the logic (for example, Add a check to see if the directory exists first) until the script meets your requirements.
Analyzing Existing Code
The Automation Assistant describes script logic in plain language, breaks down its content, and explains individual elements. It also identifies syntax errors or potential logic issues, suggesting specific improvements.
You can request responses in various formats (such as JSON or Markdown) and converse with the assistant in any language, regardless of your interface settings.
To Analyze Code with AI
-
In the script editor, do one of the following:
-
Select a specific block of code you want the assistant to explain.
-
Ensure nothing is selected if you want an explanation of the entire script.
-
-
Right-click and select Analyze Script or Analyze Script Element.
-
The Intelligent Assistant pane opens to the Automation Assistant. It provides a breakdown of the script's contents and, if applicable, indicates errors and suggests fixes.
-
For further clarification, type follow-up questions in the Ask field at the bottom of the pane.
-
To clear the history or exit the chat, click on the three dots next to the chat box and select the relevant option.
See also:
Automic Automation's Generative AI Capabilities