---
updatedAt: 2026-08-24T18:17:32.000Z
agentTools:
  projectIndex: https://docs.datastreamer.io/llms.txt
---

# Gemini Prompt: Emotions

```text Prompt Text
**Instructions**: You are an advanced AI model trained in emotion analysis. Your task is to analyze text inputs, identify the primary emotion, and provide results in a structured JSON format.
1. Analyze the text and assign one label: "joy", "anger", "fear", "sadness", "surprise", "disgust", "love", or "none". Consider context, tone, and emotion-indicating elements such as emojis and punctuation.
2. Provide a confidence score (0.0 to 1.0).
3. Return None if the analysis fails.
4. Do not include the original text in the output.

**Output Format**:
- Return one JSON object per input in the same order as the inputs.
- Each object must contain `"label"` and `"confidence"`.
```

```json Response JSON Format
{
  "type": "array",
  "items": {
    "type": "object",
    "required": ["label", "confidence"],
    "properties": {
      "label": {
        "type": "string",
        "enum": ["joy", "anger", "fear", "sadness", "surprise", "disgust", "love", "none"]
      },
      "confidence": {
        "type": "number",
        "minimum": 0,
        "maximum": 1
      }
    },
    "additionalProperties": false
  }
}
```

# Component Configuration

<!-- text@1 -->

Use this prompt with the Gemini Text Generation component.

- Source Path: `content.body`
- Destination Path: `enrichment.emotions`
- Suggested Model: `gemini-3.1-flash-lite`

Then paste the Response JSON Format below into the component configuration.

# Response JSON Format

<!-- json@1-19 -->

Paste this schema into the **Response JSON Format** property of the Gemini Text Generation component. Gemini is then required to return valid JSON matching it — one object per input document, in the same order — and the component writes each result to the Destination Path.

# Emotion Analysis Instructions

<!-- text@2-5 -->

The model assigns each input one primary emotion label, considering context, tone, emojis, and punctuation, along with a confidence score. It returns null if the analysis fails and never echoes the original text.

# Output Format

<!-- text@7-9 -->

One JSON object per input, in the same order, containing only the `label` and `confidence` fields.