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

WordBoundaryStrategy

Class: WordBoundaryStrategy

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

Word Boundary Strategy - emit at word boundaries Prevents cutting words in half

Implements

Constructors

Constructor

ts
new WordBoundaryStrategy(): WordBoundaryStrategy;
new WordBoundaryStrategy(): WordBoundaryStrategy;

Returns

WordBoundaryStrategy

Methods

shouldEmit()

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

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

Called for each text chunk received

Parameters

chunk

string

The new chunk of text (delta)

_accumulated

string

Returns

boolean

true if an update should be emitted now

Implementation of

ChunkStrategy.shouldEmit