Skip to main content

assemblePrompt

@forge/monorepo


@forge/monorepo / backend/src / assemblePrompt

Function: assemblePrompt()

assemblePrompt(input): AssembledPrompt

Defined in: backend/src/context/assembler.ts:67

Assemble a budgeted prompt from already-gathered sections. Pure and deterministic, so composition is previewable: the returned preview lists every section with its token estimate and whether it was included. modelContextTokens is the hard input limit the assembled prompt must fit within.

Parameters

input

budget

ContextBudget

modelContextTokens

number

sections

readonly ContextSection[]

Returns

AssembledPrompt