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

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

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

> [!NOTE]
>
> Tool ID: `discolike_segment`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'discolike_segment',
  {
    "domains": "example.com"
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline tools execute discolike_segment --input '{
  "domains": "example.com"
}' --json
```

## Example response

The SDK returns this shape at `result.toolResponse.raw`. The example values illustrate the response.

```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
{
  "data": {
    "status": "in_progress"
  }
}
```

Use `deepline describe discolike_segment --json` for the latest machine-readable contract.

## Input reference

Segments a comma-separated list of domains into topic clusters using ML-based clustering. Returns a task ID for async processing.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.domains` | `string` | Yes | — | — |
| `payload.max_segments` | `integer` | No | — | Minimum: 2. Maximum: 20. |
| `payload.poll_interval_ms` | `integer` | No | `2000` | Polling interval used while waiting for the segment task to finish. Defaults to 2000 ms. Minimum: 250. Maximum: 10000. |
| `payload.max_wait_ms` | `integer` | No | `45000` | Maximum time to wait for terminal DiscoLike segment results. Defaults to 45000 ms. Minimum: 1000. Maximum: 120000. |

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

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "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 reference

Standard tool result payload.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | Final DiscoLike Segment API task result returned by Deepline after synchronous polling. |
| `result.data.status` | `"in_progress" \| "completed" \| "failed"` | Yes | — | Task status. Allowed: `in_progress`, `completed`, `failed`. |
| `result.data.progress` | `integer` | No | — | Progress percentage. Minimum: 0. Maximum: 100. |
| `result.data.results` | `array` | No | — | BizData profiles with segment assignment fields. |
| `result.data.results[].domain` | `string` | No | — | Company domain. |
| `result.data.results[].name` | `string` | No | — | Company name. |
| `result.data.results[].score` | `number` | No | — | DiscoLike score. |
| `result.data.results[].segment_id` | `integer` | No | — | Assigned segment ID. |
| `result.data.results[].segment_description` | `string` | No | — | AI-generated segment description. |
| `result.data.results[].probability` | `number` | No | — | Confidence of segment assignment. |
| `result.meta` | `object` | No | — | Additional response metadata (status, paging). |

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

  ### Output JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "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>

## Deepline cost

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

## Related documentation

* [DiscoLike provider guide](https://deepline.com/docs/providers/discolike/guide.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.