# לסכם

> הוחלף בשלב סוכן AI. תנו לסוכן את ההנחיה "כתוב סיכום קצר של המסמך".

Source: https://docs.go-lumen.ai/he/reference/steps/summarize

## במבט אחד

| מאפיין | ערך |
| --- | --- |
| **שם השלב** | `summarize` |
| **משאב** | ClusterStep (`lumen.ai/v1alpha1`) |
| **קבוצה וקטגוריה** | ai, ai |
| **קרדיטים** | **0.5** קרדיטים בכל פעם שהוא מצליח |
| **השפעה חיצונית** | לא |
| **ההתקנה צריכה לספק** | כלום |

## קלט

| מאפיין | ערך |
| --- | --- |
| **צריך** | `text` |
| **מפיק** | `fields` |
| **עובד על** | item: מסמך אחד בכל פעם |

״צריך״ ו״מפיק״ הם סוגי נתונים (file, text, fields, email). העורך מציע שלב רק במקום שבו מה שהוא צריך כבר נמצא במסלול. ראו [מסמכים ונתונים](https://docs.go-lumen.ai/he/concepts/how-flows-run.md#documents-and-data).

## פלט

אין פלטים בשם. הצמתים הבאים עדיין רואים את כל מה שהופק קודם במסלול, והשלב מעביר את המסמכים הלאה כמו שהם.

## הגדרות

מגדירים תחת `config:` בצומת של התהליך. הגדרות טקסט יכולות להכיל מצייני מקום כמו `{nodeId.field}`.

| הגדרה | סוג | ברירת מחדל | תיאור |
| --- | --- | --- | --- |
| `files` | object |  |  |
| `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) |

ה-JSON Schema המלא של ההגדרות: [summarize.schema.json](https://docs.go-lumen.ai/schemas/steps/summarize.schema.json).

## שימוש בתהליך

צומת שמריץ את `summarize` נכנס תחת `spec.nodes` של [Flow](https://docs.go-lumen.ai/he/concepts/how-flows-run.md#the-flow-as-yaml). תנו לו כל מזהה, ורשמו ב-next את מזהי הצמתים הבאים.

```yaml title="flow.yaml"
apiVersion: lumen.ai/v1alpha1
kind: Flow
metadata:
  name: summarize-example
  namespace: tenant-acme
spec:
  displayName: "Summarize it"
  triggers:
    - id: start
      ref: {name: manual-run}
      next: [summarize]
  nodes:
    - id: summarize
      stepRef: {name: summarize}
```
