Free cookie consent management tool by TermsFeed

Execute Generative AI Skill Smart Service

Overview

The Execute Generative AI Skill smart service lets you integrate your AI skill into your process. This smart service takes input and appends it to the prompt you created in the relevant AI skill. Then, the smart service sends the compiled prompt to a generative artificial intelligence model, which returns an output.

The smart service takes a document, email, or text as input. Review the list of generative AI skills you can use with this smart service.

Permissions

The user who executes the process model doesn't need to have access to the AI skill being called by the Execute Generative AI Skill smart service. However, without those permissions, some smart service configuration options are masked.

Properties

  • Category: AI_Skills
  • Icon:
  • Assignment options: Unattended

Configuration options

Setup tab

The Setup tab allows you to select an AI skill.

  • Select AI Skill: Search or browse for an AI skill to use with this smart service.

Data tab

Node inputs

Inputs change based on the AI skill you use with this smart service.

Document inputs
Name Data Type Description Required Multiple
Input Document Document Runtime document that will be appended to the prompt configured in the selected AI skill. Y N
Email inputs
Name Data Type Description Required Multiple
Input Email Document Runtime email that will be appended to the prompt configured in the selected AI skill. Y N
Text inputs

Ensure your input format matches the format specified in the prompt. For example, if the prompt includes instructions for the AI to format a list or map into JSON, ensure the input is in list or map format.

Name Data Type Description Required Multiple
Input Text Text Runtime text that will be appended to the prompt configured in the selected AI skill. Y N

Node outputs

The smart service returns the model's response as text. If the model encounters an error, details are returned in the Error Message output.

Output Data Type Multiple Description
Success Boolean N Returns true if the execution was successful or false if it was unsuccessful.
Response Text N The model's response.
Error Message Text N When applicable, the error message returned by the model.

Usage considerations

Activity chaining is supported.

The AI model has a maximum limit of 100,000 tokens to analyze per call. If the combined prompt and input text exceed this limit, you may encounter an error.

If any of these guardrails are limiting, please reach out to your Appian contact.

Input requirements

Input requirements correspond to the type of AI skill you're using with the smart service. Refer to the table below to see the requirements for each AI skill using that input type.

Requirement Document input Email input Text input
File type PDF, digital or scanned EML N/A
File size limit 25MB 25MB N/A
Page limit per file 100 pages N/A N/A

Examples

Using JSON

You can pass JSON as input to the smart service, or have JSON returned as output as defined in the prompt. JSON is a common format to create key-value pairs of data that interests you, and it is easily understood by AI models. Therefore, JSON is an easy way to ask the AI skill to return structured data. Once the output is passed to the process model, you can use functions such as a!fromJson to cast the data to Appian data types.

Example prompt

In this example prompt, we ask the AI to find information within an unstructured document, such as a contract.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<role>
You are an expert at sifting through large amounts of information and finding the entities of interest. Find the below entities from the input information. Here are the entities you need to return:
</role>

Use the <input> to fill out all <entities>:
<entities>
{
  "invoiceNumber" (type: text)
  "orderNumber" (type: text)
  "invoiceDate" (type: date)
  "dueDate" (type: date)
  "totalDue" (type: decimal)
  "items" (type: list of objects): 
        "Hours/Qty" (type: decimal)
        "Service" (type: text)
        "Rate/Price" (type: decimal)
        "Adjust" (type: decimal)
        "Subtotal" (type: decimal)
}
</entities>

<instructions>
- Only output <entities> listed above from the <input>.
- Provide output in valid JSON format, make sure to not include trailing commas at the end of lists
- For fields of 'date' type, return value using ISO 8601 format yyyy-MM-dd, do not return time if present
</instructions>
Copy

When executed via the smart service, the prompt returns the following output:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
  "invoiceNumber": "INV-3337", 
  "orderNumber": "12345",
  "invoiceDate": "2016-01-25", 
  "dueDate": "2016-01-31",
  "totalDue": "93.50",
  "items": [
    {
      "Hours/Qty": "1.00",
      "Service": "Web Design",
      "Rate/Price": "$85.00",
      "Adjust": "0.00%",
      "Subtotal": "$85.00"
      }
  ]
}
Copy

Configure the smart service to store the output as a process variable such as pv!jsonOuput, so you can work with it more easily in later nodes.

Using a script task and the a!fromJson function, you can then cast this data to a record type:

1
2
3
4
cast(
  recordType!Orders,
  a!fromJson(pv!jsonOutput)
)
Copy

Finally, add and configure a Write Records smart service to save the data to the record type.

Runtime behavior

At run-time, the smart service calls a machine learning model that is associated with the AI skill configured in the Setup tab.

Possible error messages

Consult the following table to learn how to fix common errors when using this smart service:

Error message Reason Remedy
Invalid input. The combination of the prompt and input text may exceed the maximum size accepted by the AI model. Reduce the prompt or input text size and try again. The prompt and input are too large for the AI model to analyze. Reduce the size of either the prompt or the input and try again.
There is a problem with the task "Execute Prompt" in the process "process_model_name". The underlying AI Skill object has been deleted or is otherwise invalid. Please confirm the node's configuration and try again. The Execute Generative AI Skill smart service is referring to an AI skill design object that no longer exists. Reconfigure the smart service to use an existing AI skill.
The parameter Input Text has an invalid value or is missing. The smart service input is empty. Reconfigure the smart service to pass a value into the input variable.
The underlying AI Skill object has an invalid prompt or the prompt is empty. The AI skill does not have the prompt defined. Edit the AI skill and add a prompt.
An unexpected error occurred while executing the Smart Service. Unknown issue communicating with the AI model. Try again later.
The AI model took too long to respond and timed out. The AI model takes too long to respond to the request. Try again later.
The number of requests exceeds the service quota. Try again later. The number of requests to the AI model exceeds the service quota. Reduce the number of calls to the AI model and try again.
The number of requests and tokens exceeds the limit allowed per minute. Reduce usage or try again later. The number of requests and tokens per minute exceeds the limit. Reduce the size of each prompt and number of calls to the AI model and try again.

Feedback