UNPKG

@promptbook/vercel

Version:

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

57 lines (56 loc) 2.08 kB
import type { AgentModelRequirements } from '../../book-2.0/agent-source/AgentModelRequirements'; import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition'; /** * META commitment definition * * The META commitment handles all meta-information about the agent such as: * - META IMAGE: Sets the agent's avatar/profile image URL * - META LINK: Provides profile/source links for the person the agent models * - META TITLE: Sets the agent's display title * - META DESCRIPTION: Sets the agent's description * - META [ANYTHING]: Any other meta information in uppercase format * * These commitments are special because they don't affect the system message, * but are handled separately in the parsing logic for profile display. * * Example usage in agent source: * * ```book * META IMAGE https://example.com/avatar.jpg * META LINK https://twitter.com/username * META TITLE Professional Assistant * META DESCRIPTION An AI assistant specialized in business tasks * META AUTHOR John Doe * META VERSION 1.0 * ``` * * @private [🪔] Maybe export the commitments through some package */ export declare class MetaCommitmentDefinition extends BaseCommitmentDefinition<`META${string}`> { constructor(); /** * Short one-line description of META commitments. */ get description(): string; /** * Markdown documentation for META commitment. */ get documentation(): string; applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements; /** * Extracts meta information from the content based on the meta type * This is used by the parsing logic */ extractMetaValue(metaType: string, content: string): string | null; /** * Validates if the provided content is a valid URL (for IMAGE and LINK types) */ isValidUrl(content: string): boolean; /** * Checks if this is a known meta type */ isKnownMetaType(metaType: string): boolean; } /** * Note: [💞] Ignore a discrepancy between file name and entity name */