ASK_AI
Use the ASK_AI script function to leverage Automic Automation's Gen AI function for AE scripting tasks. You can incorporate Gen AI into your scripting by asking contextual questions which are automatically considered during the execution, thus enabling further automatic processing of the data returned by the AI without requiring user interaction.
For example, you can use ASK_AI to get enhanced notification emails in which an error code is explained, or summarized, or translated to a different language, or delivered in JSON format, and so on.
Syntax
ASK_AI(Prompt [, Data][, Query])
Parameters
-
Prompt
Input that instructs the AI model to generate the output you require.
Format: Text structured as a question or a statement aimed to guide the AI's creative process. -
Data
(Optional) Additional data to further define the prompt.
Format: Text -
Query
(Optional) Additional, more straightforward request seeking factual information or a direct answer.
Format: Text structured in a more direct, less contextual way to retrieve specific data.
Example
Assumption: I already have set up an ALARM Notification that notifies me when a Job execution returns an error. The ALARM Notification already has a template that displays the RunID, the execution start time and the end status.
As an operator, I want that ALARM Notification email to include an explanation for the error and suggest resolution steps, so that I can address those issues quickly without having to do extra research, thus saving time and improving efficiency. To do so, I can use the ASK_AI script function to have my LLM analyze the report of the failed job and explain me what caused the error in one or more languages.
:PRINT &TEXT#
:SET &ANSWER# = ASK_AI("Explain the following report in English and check if this contains an error message. Here is the text:{data}.{query}", "Error in Job FILETRANSFER.XXXXXX_XXX with Runid <123456789>", "If yes, show me possible solutions.")
:SET &ANSWER# = ASK_AI("Explain the following report in Korean and check if this contains an error message. Here is the text:{data}.{query}", "Error in Job FILETRANSFER.XXXXXX_XXX with Runid <123456789>", "If yes, show me possible solutions.")
:PRINT &ANSWER#
The ALARM Notification email includes not only the Job's RunID, the execution start time and the end status, but would also include additional information gathered by the AI as well as possible solutions, in both languages. For example:
From: <system@automic.com> Date: Thu, Nov 28, 2024 at 3:22 PM Subject: Alarm:'FILETRANSFER.XXXXXX_XXX' RunID:'<job's RunID>' Client:'1234' To: <your email address> Job Execution Error Error in Job FILETRANSFER.XXXXXX_XXX with Runid <job's RunID> Additional Information ## Explanation of the report: This report describes the process of a file transfer initiated by user `<your user>` with file transfer ID `<job's ID>`. **Here's a breakdown of the steps:** 1. **Initiation:** The user initiates a connection to the agent `<agent>` at 2024-11-28 14:22:31.000. 2. **Connection:** The user connects to the agent's IP address `<IP address>` on port `<port>`. 3. **Selection:** The user starts a selection process with the filter `/home/uc4/image.iso`. 4. **File selection:** The filter selects the file `/home/xxx/image.iso`. 5. **File count:** The report confirms that one file is selected. 6. **Error:** The report indicates an error: "File '/home/xxx/new/image.iso' already exists." 7. **Abnormal termination:** The file transfer ends abnormally due to the error. ## Error message and possible solutions: The error message is: "File '/home/xxx/new/image.iso' already exists." This means that the file the user is trying to transfer already exists in the destination directory. **Possible solutions:** 1. **Overwrite the existing file:** If the existing file is no longer needed, you can overwrite it by adding the `-f` flag to the transfer command. This will force the transfer to overwrite the existing file. 2. **Rename the existing file:** If you want to keep the existing file, you can rename it before starting the transfer. This will allow the new file to be transferred with the same name. 3. **Choose a different destination directory:** You can choose a different destination directory where the file does not already exist. 4. **Delete the existing file:** If the existing file is no longer needed, you can delete it before starting the transfer. This will allow the new file to be transferred with the same name. ## Conclusion: The file transfer failed due to an existing file with the same name in the destination directory. You can choose one of the solutions above to resolve the issue and successfully transfer the file. Korean ## 한국어 설명 및 오류 확인 ### 보고서 설명 2024년 11월 28일 14시 22분 31초에 시작된 파일 전송 작업에 대한 로그입니다. ...
See also: