Skip to content

PredictivePreFetcher

new PredictivePreFetcher(config): PredictivePreFetcher;
Parameter Type

config

PredictivePreFetcherConfig

PredictivePreFetcher

prefetch(messages): Promise<{
keywords: string[];
resultCount: number;
}>;

Predict follow-up topics from the conversation and pre-fetch relevant content into the cache. Runs in the background — the returned promise can be fire-and-forget.

Parameter Type Description

messages

object[]

Recent conversation messages (role + content pairs).

Promise<{ keywords: string[]; resultCount: number; }>

Keywords that were used for pre-fetching.