UNPKG

@promptbook/azure-openai

Version:

Promptbook: Run AI apps in plain human language across multiple models and platforms

38 lines (37 loc) 1.15 kB
/** * Additional options for `unwrapResult` */ type UnwrapResultOptions = { /** * If true, the text is trimmed before processing */ readonly isTrimmed?: boolean; /** * If true, the introduce sentence is removed * * For example: * - If `true`> 'Hello, "world"' -> 'world' * - If `false`> 'Hello, "world"' -> 'Hello, "world"' * * @default true */ readonly isIntroduceSentenceRemoved?: boolean; }; /** * Removes quotes and optional introduce text from a string * * Tip: This is very useful for post-processing of the result of the LLM model * Note: This function trims the text and removes whole introduce sentence if it is present * Note: There are two similar functions: * - `removeQuotes` which removes only bounding quotes * - `unwrapResult` which removes whole introduce sentence * * @param text optionally quoted text * @returns text without quotes * @public exported from `@promptbook/utils` */ export declare function unwrapResult(text: string, options?: UnwrapResultOptions): string; export {}; /** * TODO: [🧠] Should this also unwrap the (parenthesis) */