# SummarizeFn
Source: https://docs.maelstrom-ai.co/dev/reference/realtime/type-aliases/summarizefn/
Documentation revision: 89a8f5e9d10cedcf0b30376d7846113f06f26120
SDK manifests in this build: @maelstrom-co/react@0.2.1, @maelstrom-co/client@0.2.1, @maelstrom-co/connectors@0.2.1, @maelstrom-co/protocol@0.2.1, @maelstrom-co/engine@0.2.1
These docs follow this source revision. Manifest versions do not prove release compatibility; verify the installed package exports before using an API.

> **SummarizeFn** = (`snapshot`) => `string`

Defined in: [packages/realtime/src/lib/realtime-session/realtime-session.types.ts:135](https://github.com/maelstrom-co/maelstrom/blob/89a8f5e9d10cedcf0b30376d7846113f06f26120/packages/realtime/src/lib/realtime-session/realtime-session.types.ts#L135)

Pure, model-free formatter turning a structural snapshot into a short sentence. Injectable so callers can swap in richer copy without touching sequencing logic; the default is deterministic and O(1) — grounding must never involve a model call.

Backs two paths: every latest-wins grounding push and the structural fallback summary for an `submit_intent` tool result. It does not summarize the direct `get_ui_state` pull, which returns its UIStructuralSnapshot directly. That snapshot already contains visible-only Instances. When the settled [SubmitIntentResult](https://docs.maelstrom-ai.co/dev/reference/realtime/interfaces/submitintentresult/) carries a non-empty `userMessage`, that engine reply remains the preferred product voice over the structural fallback.

## Parameters

### snapshot

`UIStructuralSnapshot`

## Returns

`string`
