---
schema_version: "1"
id: 1201198fd7da9205400c321e0268c10352e5cc6af77c5e27d7d96eb1ad551f6b
title: Configuring Sentiment Operations
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/mulesoft-ai-chain-connector/1.0/configuring-sentiment-operations.md
canonical_url: https://docs.mulesoft.com/mulesoft-ai-chain-connector/1.0/configuring-sentiment-operations
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 57a3739568fd6190d42a53304ff426f792d7752e51f69f9b6253114745fd8c9a
description: MuleSoft Documentation Site
release: "1.0"
latest: false
---
---
product: MuleSoft AI Chain Connector
version: 1.0
---

# Configuring Sentiment Operations

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

Support for MuleSoft AI Chain Connector 1.0 ends on October 30, 2026. Use one of the other available
[MuleSoft AI connectors](https://docs.mulesoft.com/general/learning-map-mulesoft-ai) based on your requirements.

## Configure the Sentiment Analyzer Operation

Use the **Sentiment analyzer** operation to send a simple prompt request to the configured LLM. This
operation uses a plain text prompt as input and responds with a sentiment for the input text. The
sentiment value can be NEUTRAL, POSITIVE, or NEGATIVE.

To configure the **Sentiment analyzer** operation:

1.  Select the operation on the Studio canvas.

2.  In the **General** properties section, enter plain text to analyze for its sentiment in the
    **Prompt** field.

This is the XML configuration for this operation:

```xml
<ms-aichain:sentiment-analyze
  doc:name="Sentiment analyze"
  doc:id="cad4ef27-5c85-47f7-a68c-f666809b0846"
  config-ref="MAC_AI_Llm_configuration"
  data="#[payload.inputText]"
/>
```

### Output Configuration

This operation responds with a JSON payload that contains the sentiment of the input text.
Additionally, attributes such as token usage and sentiment details are included as part of the
metadata (attributes) but not within the main payload.

This is an example response of the JSON payload:

```json
{
  "response": "POSITIVE"
}
```

Along with the JSON payload, the operation returns attributes, which include information about token
usage, for example:

```json
{
  "tokenUsage": {
    "outputCount": 2,
    "totalCount": 39,
    "inputCount": 37
  },
  "additionalAttributes": {
    "isPositive": "false"
  }
}
```

## 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)

- [MuleSoft AI Chain Connector Overview](https://docs.mulesoft.com/mulesoft-ai-chain-connector/1.0/)

- [MuleSoft AI Chain Connector Reference](https://docs.mulesoft.com/mulesoft-ai-chain-connector/1.0/mulesoft-ai-chain-connector-reference)

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