Class: TurnContextEnricher
Makaio Framework / services-core / TurnContextEnricher
Class: TurnContextEnricher
Section titled “Class: TurnContextEnricher”Defined in: ../../../packages/services/core/src/session/turn-context-enricher.ts:15
Enriches messageHistory with turn-so-far messages for immediate delivery.
Uses MessageStorageSubjects to load messages already persisted in the current turn. For immediate messages within an active turn, this provides context from:
- The initiating user message
- Any assistant responses from agents that have already completed
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new TurnContextEnricher(
bus):TurnContextEnricher
Defined in: ../../../packages/services/core/src/session/turn-context-enricher.ts:16
Parameters
Section titled “Parameters”Returns
Section titled “Returns”TurnContextEnricher
Methods
Section titled “Methods”enrichForDeliveryMode()
Section titled “enrichForDeliveryMode()”enrichForDeliveryMode(
originalHistory,turnId,deliveryMode):Promise<object[] |undefined>
Defined in: ../../../packages/services/core/src/session/turn-context-enricher.ts:47
Enrich messageHistory for immediate delivery mode.
Parameters
Section titled “Parameters”originalHistory
Section titled “originalHistory”object[] | undefined
Curated history from sessionContext
turnId
Section titled “turnId”string
Turn ID for current turn
deliveryMode
Section titled “deliveryMode”"replace" | "enqueue" | "immediate" | undefined
Message delivery mode
Returns
Section titled “Returns”Promise<object[] | undefined>
Enriched messageHistory (original + turn-so-far for immediate)
getTurnSoFarContext()
Section titled “getTurnSoFarContext()”getTurnSoFarContext(
turnId):Promise<object[]>
Defined in: ../../../packages/services/core/src/session/turn-context-enricher.ts:23
Load turn-so-far messages and convert to Message[].
Parameters
Section titled “Parameters”turnId
Section titled “turnId”string
Turn ID to load context for
Returns
Section titled “Returns”Promise<object[]>
Messages representing turn-so-far context