{"version":3,"file":"string.cjs","names":["BasePromptTemplate","StringPromptValue"],"sources":["../../src/prompts/string.ts"],"sourcesContent":["// Default generic \"any\" values are for backwards compatibility.\n// Replace with \"string\" when we are comfortable with a breaking change.\n\nimport type { InputValues } from \"../utils/types/index.js\";\nimport {\n  type StringPromptValueInterface,\n  StringPromptValue,\n} from \"../prompt_values.js\";\nimport { BasePromptTemplate, type TypedPromptInputValues } from \"./base.js\";\n\n/**\n * Base class for string prompt templates. It extends the\n * BasePromptTemplate class and overrides the formatPromptValue method to\n * return a StringPromptValue.\n */\nexport abstract class BaseStringPromptTemplate<\n  // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n  RunInput extends InputValues = any,\n  // oxlint-disable-next-line @typescript-eslint/no-explicit-any\n  PartialVariableName extends string = any,\n> extends BasePromptTemplate<\n  RunInput,\n  StringPromptValueInterface,\n  PartialVariableName\n> {\n  /**\n   * Formats the prompt given the input values and returns a formatted\n   * prompt value.\n   * @param values The input values to format the prompt.\n   * @returns A Promise that resolves to a formatted prompt value.\n   */\n  async formatPromptValue(\n    values: TypedPromptInputValues<RunInput>\n  ): Promise<StringPromptValueInterface> {\n    const formattedPrompt = await this.format(values);\n    return new StringPromptValue(formattedPrompt);\n  }\n}\n"],"mappings":";;;;;;;;AAeA,IAAsB,2BAAtB,cAKUA,aAAAA,mBAIR;;;;;;;CAOA,MAAM,kBACJ,QACqC;AAErC,SAAO,IAAIC,sBAAAA,kBADa,MAAM,KAAK,OAAO,OAAO,CACJ"}