Skip to Content

PromptPreProcessor

PromptPreProcessor = (ctx: PromptPreProcessorContext) => LlmapiMessage[] | void | Promise<LlmapiMessage[] | void>

Defined in: src/lib/chat/preProcessor.ts:17 

Returns context messages to insert before the latest user message, or nothing to leave the conversation unchanged. Thrown errors are caught by the tool loop so a failing pre-processor does not abort the LLM request.

Parameters

ParameterType

ctx

PromptPreProcessorContext

Returns

LlmapiMessage[] | void | Promise<LlmapiMessage[] | void>

Last updated on