UNPKG

@promptbook/utils

Version:

Promptbook: Turn your company's scattered knowledge into AI ready books

45 lines (44 loc) 1.64 kB
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements'; import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition'; /** * TEMPLATE commitment definition * * The TEMPLATE commitment enforces a specific response structure or template * that the agent must follow when generating responses. This helps ensure * consistent message formatting across all agent interactions. * * Example usage in agent source: * * ```book * TEMPLATE Always structure your response with: 1) Summary, 2) Details, 3) Next steps * TEMPLATE Use the following format: **Question:** [user question] | **Answer:** [your answer] * ``` * * When used without content, it enables template mode which instructs the agent * to follow any template patterns defined in other commitments or context. * * @private [🪔] Maybe export the commitments through some package */ export declare class TemplateCommitmentDefinition extends BaseCommitmentDefinition<'TEMPLATE' | 'TEMPLATES'> { constructor(type?: 'TEMPLATE' | 'TEMPLATES'); /** * Short one-line description of TEMPLATE. */ get description(): string; /** * Icon for this commitment. */ get icon(): string; /** * Markdown documentation for TEMPLATE commitment. */ get documentation(): string; /** * TEMPLATE can be used with or without content. */ get requiresContent(): boolean; applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements; } /** * Note: [💞] Ignore a discrepancy between file name and entity name */