Docs
Code Rabbit
Cloudflare
AG Grid
Netlify
Neon
WorkOS
Clerk
Convex
Electric
Sentry
Prisma
Strapi
Unkey
UI.dev
Code Rabbit
Cloudflare
AG Grid
Netlify
Neon
WorkOS
Clerk
Convex
Electric
Sentry
Prisma
Strapi
Unkey
UI.dev
Class References
Function References
Interface References
Type Alias References
Variable References
Class References

BatchStrategy

Class: BatchStrategy

Defined in: activities/chat/stream/strategies.ts:34

Batch Strategy - emit every N chunks Useful for reducing UI update frequency

Implements

Constructors

Constructor

ts
new BatchStrategy(batchSize): BatchStrategy;
new BatchStrategy(batchSize): BatchStrategy;

Defined in: activities/chat/stream/strategies.ts:37

Parameters

batchSize

number = 5

Returns

BatchStrategy

Methods

reset()

ts
reset(): void;
reset(): void;

Defined in: activities/chat/stream/strategies.ts:48

Optional: Reset strategy state (called when streaming starts)

Returns

void

Implementation of

ChunkStrategy.reset


shouldEmit()

ts
shouldEmit(_chunk, _accumulated): boolean;
shouldEmit(_chunk, _accumulated): boolean;

Defined in: activities/chat/stream/strategies.ts:39

Called for each text chunk received

Parameters

_chunk

string

_accumulated

string

Returns

boolean

true if an update should be emitted now

Implementation of

ChunkStrategy.shouldEmit