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

# Gemini Prompt: ESG Classification

```text Prompt Text
**Instructions**: You are an advanced AI model trained in ESG classification. Your task is to analyze text inputs, identify the primary ESG category, and provide results in a structured JSON format.
1. Analyze the text and assign one label: "environmental", "social", "governance", or "none". Consider the context and the primary subject of the text.
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": ["environmental", "social", "governance", "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.esg`
- 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.

# ESG Classification Instructions

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

The model assigns each input one ESG label ("environmental," "social," "governance," or "none") based on context and primary subject, 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.