---
url: >-
  https://adk.nht.io/api/@nhtio/adk/batteries/llm/litert_lm/helpers/interfaces/LiteRtStreamAccumulator.md
description: A streaming accumulator over LiteRT `ReadableStream<Message>` chunks.
---

# Interface: LiteRtStreamAccumulator

Defined in: [src/batteries/llm/litert\_lm/helpers.ts:643](https://github.com/NHTIO/ADK/blob/v1.20260713.1/src/src/batteries/llm/litert_lm/helpers.ts#L643)

A streaming accumulator over LiteRT `ReadableStream<Message>` chunks.

## Remarks

Each chunk is a partial [LiteRtMessage](../../types/type-aliases/LiteRtMessage.md). The `@litert-lm/core` v0.13.1 JS runtime is
**text-in / text-out**: it emits `content` only and does NOT populate `tool_calls` or `channels` on
output (those wire fields exist for feeding history back IN). Tool calls and reasoning come out as
**raw text inside `content`**, in the model family's own format — the adapter parses them out after
the stream drains via the shared tool-call / reasoning parser layer.

So the accumulator collects assistant `content` text only, handling BOTH delivery conventions —
incremental deltas (append) and full-accumulated snapshots (replace) — by detecting whether the
incoming value extends the running buffer (`startsWith`) or is a fresh fragment. It also tolerates
`content` arriving as a `MessageContentItem[]` by concatenating the text items.

## Methods

### content()

```ts
content(): string;
```

Defined in: [src/batteries/llm/litert\_lm/helpers.ts:647](https://github.com/NHTIO/ADK/blob/v1.20260713.1/src/src/batteries/llm/litert_lm/helpers.ts#L647)

Final assembled content text.

#### Returns

`string`

***

### feed()

```ts
feed(chunk: Message): {
  contentDelta: string;
};
```

Defined in: [src/batteries/llm/litert\_lm/helpers.ts:645](https://github.com/NHTIO/ADK/blob/v1.20260713.1/src/src/batteries/llm/litert_lm/helpers.ts#L645)

Feed one chunk; returns the newly-appended content text (for incremental reporting).

#### Parameters

| Parameter | Type      |
| --------- | --------- |
| `chunk`   | `Message` |

#### Returns

```ts
{
  contentDelta: string;
}
```

| Name           | Type     | Defined in                                                                                                                                    |
| -------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| `contentDelta` | `string` | [src/batteries/llm/litert\_lm/helpers.ts:645](https://github.com/NHTIO/ADK/blob/v1.20260713.1/src/src/batteries/llm/litert_lm/helpers.ts#L645) |
