@yamlresume/ai
    Preparing search index...

    Function generateWithValidation

    • Generate content with an LLM, parse and validate the result as YAMLResume, and retry when validation fails.

      The caller provides the prompts and a post-processor that transforms the parsed YAML document into the final result. Validation errors trigger retries with feedback appended to the original prompt. Non-validation errors are wrapped as provider errors and thrown immediately.

      Type Parameters

      • T

      Parameters

      • options: GenerateWithValidationOptions

        The generation options, prompts, and task description.

      • postProcessResume: (text: string, doc: Document) => T | Promise<T>

        Callback that receives the raw text and parsed YAML document and returns the final result.

      Returns Promise<T>

      The result returned by postProcessResume.

      When the provider fails or validation ultimately fails.