Skip to content
1 min read · 79 words

Type Alias: MessageRetrievalFn

ts
type MessageRetrievalFn = (ctx: TurnContext) => Message[] | Promise<Message[]>;

A function that retrieves the conversation messages relevant to the current turn.

Parameters

ParameterType
ctxTurnContext

Returns

| Message[] | Promise<Message[]>

Remarks

Receives the active TurnContext so implementations can apply turn-aware filtering or windowing. Returns only user and assistant @nhtio/adk!Message entries — system instructions and tool results are not part of the persisted message history. May be synchronous or asynchronous.