/** * Prompt templates (Python parity: `Agent(templates=...)` / `TemplateConfig`, * which consolidates `system_template`, `prompt_template`, * `response_template` and `use_system_prompt`). * * - `system`: replaces the instructions as the system prompt. Placeholders * `{instructions}`, `{role}`, `{goal}`, `{backstory}` and `{name}` are * substituted. * - `prompt`: wraps the user prompt; `{input}` is substituted (appended when * the template has no placeholder). * - `response`: either a wrapper applied to the answer (`{response}` * placeholder) or, without one, a formatting instruction added to the * system prompt. * - `useSystemPrompt: false`: no system message is sent at all. */ export interface TemplateConfig { system?: string; prompt?: string; response?: string; useSystemPrompt: boolean; } export interface SystemTemplateVars { instructions: string; name?: string; role?: string; goal?: string; backstory?: string; } /** Resolve the constructor option (snake_case `use_system_prompt` accepted). */ export declare function resolveTemplates(input: Record | undefined | null): TemplateConfig | undefined; /** Substitute `{key}` placeholders; unknown placeholders are left as written. */ export declare function renderTemplate(template: string, vars: Record): string; /** The system prompt body: the rendered `system` template, else the instructions. */ export declare function applySystemTemplate(config: TemplateConfig | undefined, vars: SystemTemplateVars): string; /** Wrap the user prompt with the `prompt` template. */ export declare function applyPromptTemplate(config: TemplateConfig | undefined, input: string): string; /** Whether the response template is a wrapper (has `{response}`) rather than an instruction. */ export declare function responseTemplateIsWrapper(config: TemplateConfig | undefined): boolean; /** Apply a `{response}` wrapper template to the model's answer. */ export declare function applyResponseTemplate(config: TemplateConfig | undefined, response: string): string;