> ## Documentation Index
> Fetch the complete documentation index at: https://deepline.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Discolike Segment: Inputs, Cost & CLI Example

> Cluster a set of domains by similarity, waiting for the async DiscoLike task to finish and returning segment assignments.

## Run in Enrichment Spreadsheet

<Info>
  Use this function as a column step in `deepline enrich`.
</Info>

```bash theme={null}
deepline enrich --input leads.csv --output leads.enriched.csv --with 'result=discolike_segment:{"domains":"{{domains}}"}' --json
```

<Tip>
  Map payload values to spreadsheet columns with `{{column_name}}` placeholders.
</Tip>

## Input Schema

| Name                       | Type      | Required | Default | Description                                                                              |
| -------------------------- | --------- | -------- | ------- | ---------------------------------------------------------------------------------------- |
| `payload.domains`          | `string`  | Yes      |         |                                                                                          |
| `payload.max_segments`     | `integer` | No       |         |                                                                                          |
| `payload.poll_interval_ms` | `integer` | No       | `2000`  | Polling interval used while waiting for the segment task to finish. Defaults to 2000 ms. |
| `payload.max_wait_ms`      | `integer` | No       | `45000` | Maximum time to wait for terminal DiscoLike segment results. Defaults to 45000 ms.       |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Segments a comma-separated list of domains into topic clusters using ML-based clustering. Returns a task ID for async processing.",
    "properties": {
      "domains": {
        "type": "string"
      },
      "max_segments": {
        "type": [
          "integer",
          "null"
        ],
        "minimum": 2,
        "maximum": 20
      },
      "poll_interval_ms": {
        "type": "integer",
        "description": "Polling interval used while waiting for the segment task to finish. Defaults to 2000 ms.",
        "default": 2000,
        "minimum": 250,
        "maximum": 10000
      },
      "max_wait_ms": {
        "type": "integer",
        "description": "Maximum time to wait for terminal DiscoLike segment results. Defaults to 45000 ms.",
        "default": 45000,
        "minimum": 1000,
        "maximum": 120000
      }
    },
    "required": [
      "domains"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output Schema

| Name          | Type     | Required | Default | Description                                                                             |
| ------------- | -------- | -------- | ------- | --------------------------------------------------------------------------------------- |
| `result.data` | `object` | Yes      |         | Final DiscoLike Segment API task result returned by Deepline after synchronous polling. |
| `result.meta` | `object` | No       |         | Additional response metadata (status, paging).                                          |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={null}
  {
    "type": "object",
    "description": "Standard tool result payload.",
    "properties": {
      "data": {
        "type": "object",
        "description": "Final DiscoLike Segment API task result returned by Deepline after synchronous polling.",
        "properties": {
          "status": {
            "type": "string",
            "description": "Task status.",
            "enum": [
              "in_progress",
              "completed",
              "failed"
            ]
          },
          "progress": {
            "type": "integer",
            "description": "Progress percentage.",
            "minimum": 0,
            "maximum": 100
          },
          "results": {
            "type": "array",
            "description": "BizData profiles with segment assignment fields.",
            "items": {
              "type": "object",
              "properties": {
                "domain": {
                  "type": "string",
                  "description": "Company domain."
                },
                "name": {
                  "type": "string",
                  "description": "Company name."
                },
                "score": {
                  "type": "number",
                  "description": "DiscoLike score."
                },
                "segment_id": {
                  "type": "integer",
                  "description": "Assigned segment ID."
                },
                "segment_description": {
                  "type": "string",
                  "description": "AI-generated segment description."
                },
                "probability": {
                  "type": "number",
                  "description": "Confidence of segment assignment."
                }
              },
              "additionalProperties": true
            }
          }
        },
        "required": [
          "status"
        ],
        "additionalProperties": true
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": true
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Advanced: Direct CLI

<Info>
  Use direct execution for single payload debugging.
</Info>

```bash theme={null}
deepline tools execute discolike_segment --payload '{
  "domains": "string"
}' --json
```

### CLI flags

| Flag                        | Description                                         |
| --------------------------- | --------------------------------------------------- |
| `--json`                    | Print machine-readable output.                      |
| `--wait`                    | Wait for terminal provider status when supported.   |
| `--debug`                   | Enable wait mode with additional status/log output. |
| `--wait-timeout SECONDS`    | Max seconds to wait in wait mode.                   |
| `--poll-interval SECONDS`   | Polling interval in seconds during wait mode.       |
| `--timeout SECONDS`         | Request timeout in seconds.                         |
| `--connect-timeout SECONDS` | Connection timeout in seconds.                      |

## Cost

* Pricing model: `provider_usage` (provider usage).
* Estimated Deepline credits: `0` per pricing unit.
* Billing mode: `post_deduct`.
