Circle V2 API Docs
    Preparing search index...

    Function makeSafePrompt

    • Wrap a resolved template so that rendering it can never render a silent blank: format/formatPromptValue try the primary template and, on ANY render error, log and re-render from the committed snapshot fallback. Rethrows only if the fallback itself throws (the code is broken against its own committed contract). This is the single choke point where every resolution path — and so every consumer — gets the guarantee, without changing any call site: the result still IS a BasePromptTemplate (a Proxy delegating everything except the two render methods to primary).

      Parameters

      • primary: BasePromptTemplate
      • fallback: () => BasePromptTemplate
      • name: string
      • logger: BaseLogger

      Returns BasePromptTemplate