# Sort into a category

> Replaced by an AI agent step. Tell the agent the categories, and give it the fields category, confidence and reason.

Source: https://docs.go-lumen.ai/es/reference/steps/classify

## De un vistazo

| Propiedad | Valor |
| --- | --- |
| **Nombre del paso** | `classify` |
| **Recurso** | ClusterStep (`lumen.ai/v1alpha1`) |
| **Grupo de la paleta, categoría** | ai, ai |
| **Créditos** | **1.5** créditos cada vez que tiene éxito |
| **Efectos externos** | no |
| **La instalación debe aportar** | nada |

## Entradas

| Propiedad | Valor |
| --- | --- |
| **Necesita** | nada |
| **Produce** | `fields` |
| **Trabaja sobre** | item: un documento cada vez |

Necesita y Produce son tipos de datos (file, text, fields, email). El editor ofrece un paso solo donde lo que necesita ya está en el camino. Consulta [Documentos y datos](https://docs.go-lumen.ai/es/concepts/how-flows-run.md#documents-and-data).

## Salidas

Un nodo posterior se refiere a una salida como `{nodeId.field}` en un texto, o `nodeId.field` en una condición.

| Salida | Tipo |
| --- | --- |
| `category` | string |
| `confidence` | number |
| `reason` | string |

## Ajustes

Se definen bajo `config:` en el nodo del flujo. Los ajustes de texto pueden contener marcadores de posición como `{nodeId.field}`.

| Ajuste | Tipo | Valor por defecto | Descripción |
| --- | --- | --- | --- |
| `categories` (obligatorio) | list of object |  | Categories (minItems 2; maxItems 30) |
| `categories[].name` (obligatorio) | string |  | Name (minLength 1; maxLength 60) |
| `categories[].description` | string |  | Description says what belongs here, to the model. (maxLength 300) |
| `allowOther` | boolean | `true` | AllowOther lets the answer be "other" when nothing fits. On unless set to false; off, the document is put in the closest category. |
| `files` | object |  | Files is how the step reads the document's files and how much of them. |
| `files.mode` | string | `"attach"` | Mode is attach (the model reads each file whole when it can, its text otherwise), text (only the text read out of each file) or none (no file at all). Unset is attach. ifNoText attaches them only when the document has no text, and sends none otherwise. (one of attach, text, none, ifNoText) |
| `files.maxFiles` | integer | `10` | MaxFiles is the most files one document may bring; the rest are skipped. Unset is 10. (minimum 1; maximum 100) |
| `files.maxPages` | integer | `100` | MaxPages is the most PDF pages across all files together; a PDF that crosses it is read up to the pages left. Unset is 100. (minimum 1; maximum 1000) |
| `files.maxBytes` | integer | `20971520` | MaxBytes is the most bytes, all files together. Unset is 20 MB. (minimum 1; maximum 104857600) |

El JSON Schema completo de estos ajustes: [classify.schema.json](https://docs.go-lumen.ai/schemas/steps/classify.schema.json).

## Úsalo en un flujo

Un nodo que ejecuta `classify` va bajo `spec.nodes` de un [Flow](https://docs.go-lumen.ai/es/concepts/how-flows-run.md#the-flow-as-yaml). Dale cualquier id y enumera en next los ids de los nodos siguientes.

```yaml title="flow.yaml (spec.nodes)"
- id: classify
  stepRef: {name: classify}
```
