/** * @license * Copyright 2024 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { JsonSerializable } from "@breadboard-ai/build/internal/type-system/type.js"; import promptTemplate from "./prompt-template.js"; import { Value } from "@breadboard-ai/build"; /** * A utility that makes it safer and more convenient to instantiate a * {@link promptTemplate} node using JavaScript template string literals. * * Usage: * * ```ts * import {prompt} from '@google-labs/template-kit'; * import {input} from '@breadboard-ai/build'; * * const dish = input(); * const steps = input({default: 10}); * const instructions = prompt`Write a ${dish} recipe in under ${steps} steps`; * ``` * * To customize the node id of the `promptTemplate` node that this function will * create, you can use the `configure` method: * * ```ts * const instructions = * prompt`Write a ${dish} recipe in under ${steps} steps`.configure({ * id: "recipe-template", * }); * ``` * * To customize the name of a parameter within the template, use the * {@link promptPlaceholder} function to wrap the value: * * ```ts * import {prompt, promptPlaceholder} from '@google-labs/template-kit'; * * const instructions = prompt`Write a ${promptPlaceholder(dish, { * name: "dish", * })} recipe in under ${promptPlaceholder(steps, { * name: "steps", * })} steps`; * ``` */ export declare function prompt(strings: TemplateStringsArray, ...values: Array | PromptPlaceholder>): ReturnType & { configure(config: { id: string; }): ReturnType; }; declare const PromptPlaceholderBrand: unique symbol; export declare function promptPlaceholder(value: Value, { name }: { name: string; }): PromptPlaceholder; interface PromptPlaceholder { [PromptPlaceholderBrand]: true; value: Value; name: string; } export {}; //# sourceMappingURL=prompt-template-tag.d.ts.map