Skip to main content

Class: SentenceBoundaryBuffer

Defined in: packages/agentos/src/safety/guardrails/SentenceBoundaryBuffer.ts:5

Buffers streaming TEXT_DELTA chunks and flushes at sentence boundaries. Includes the previous sentence as overlap context for safety evaluation.

Constructors​

Constructor​

new SentenceBoundaryBuffer(): SentenceBoundaryBuffer

Returns​

SentenceBoundaryBuffer

Methods​

flush()​

flush(): string | null

Defined in: packages/agentos/src/safety/guardrails/SentenceBoundaryBuffer.ts:24

Flush remaining buffer content (call on stream end).

Returns​

string | null


push()​

push(chunk): string | null

Defined in: packages/agentos/src/safety/guardrails/SentenceBoundaryBuffer.ts:10

Push a chunk. Returns evaluation payload if sentence boundary detected, null otherwise.

Parameters​

chunk​

string

Returns​

string | null


reset()​

reset(): void

Defined in: packages/agentos/src/safety/guardrails/SentenceBoundaryBuffer.ts:35

Reset all state.

Returns​

void