---
schema_version: "1"
id: 4bf99a7348340a100fa17e2d6dcd1770e8b0006a9e975c1e9aeb1f63eb3ba325
title: Configuring Agent Operations for Einstein AI Connector 1.1
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/einstein-ai-connector/1.1/configuring-agent-operations.md
canonical_url: https://docs.mulesoft.com/einstein-ai-connector/1.1/configuring-agent-operations
source_site: docs.mulesoft.com
content_type: documentation
content_hash: fb7f228b9f3ec1e9d71560ff9091600a6b6ff2da852ed0953e3c7c9c17d16b55
description: MuleSoft Documentation Site
release: "1.1"
latest: false
---
---
product: Einstein AI Connector
version: 1.1
---

# Configuring Agent Operations for Einstein AI Connector 1.1

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

## Configure the Agent Define Prompt Template Operation

Use the **Agent define prompt template** operation to define specific prompt templates for use when
integrating with the LLM of your choice. This allows you to create natural language prompts that
generate responses, extract information, invoke other prompts, or perform any text-based task.

1.  Select the operation on the Anypoint Code Builder or Studio canvas.

2.  In the **General** properties tab for the operation, enter these values:

    - **Template**

      Enter the prompt template for the operation.

    - **Instructions**

      Provide the instructions for the LLM, outlining the goals of the task.

    - **Dataset**

      Specify the dataset for the LLM to evaluate using the provided template and instructions.

3.  In **Additional properties**, enter these values:

    - **Model name**

      Select the model name. The default is `OpenAI GPT 3.5 Turbo`.

    - **Probability**

      Enter the probability of the model staying accurate. The default is `0.8`. **Locale**

      Enter the localization information, which can include the default locale, input locale(s), and
      expected output locale(s). The default is `en_US`.

This is the XML for this operation:

```xml
<ms-einstein-ai:agent-define-prompt-template
  doc:name="Agent define prompt template"
  doc:id="f1c29c39-eac9-468c-9c46-4109a66303ec"
  config-ref="Einstein_AI"
  template="#[payload.template]"
  instructions="#[payload.instructions]"
  dataset="#[payload.dataset]"
/>
```

### Output Configuration

This operation responds with a JSON payload containing the main LLM response. Additionally,
attributes such as token usage are included as part of the metadata (attributes) but not within the
main payload. This additional metadata is particularly useful to track token usage across
applications and manage costs associated with LLM adoption.

This is an example response:

```json
{
  "response": "{\n  \"type\": \"positive\",\n  \"response\": \"Thank you for your positive feedback on the training last week. We are glad to hear that you had a great experience. Have a nice day!\"\n}"
}
```

The operation also returns attributes that aren’t within the main JSON payload, which include
information about token usage, for example:

```json
{
  "tokenUsage": {
    "outputCount": 9,
    "totalCount": 18,
    "inputCount": 9
  },
  "additionalAttributes": {}
}
```

- `tokenUsage`

  Token usage metadata returned as attributes

- `outputCount`

  Number of tokens used to generate the output

- `totalCount`

  Total number of tokens used for input and output

- `inputCount`

  Number of tokens used to process the input

## See Also

- [Using Anypoint Code Builder to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-acb)

- [Using Studio to Configure a Connector](https://docs.mulesoft.com/connectors/introduction/intro-config-use-studio)

- [Einstein AI Connector Reference](https://docs.mulesoft.com/einstein-ai-connector/1.1/einstein-ai-connector-reference)

- [Einstein AI - Additional Configuration Information](https://docs.mulesoft.com/einstein-ai-connector/1.1/einstein-ai-additional-config)

- [Salesforce Help](https://help.salesforce.com)
