@gaiaverse/semantic-turning-point-detector
Version:
Detects key semantic turning points in conversations using recursive semantic distance analysis. Ideal for conversation analysis, dialogue segmentation, insight detection, and AI-assisted reasoning tasks.
53 lines • 2.23 kB
TypeScript
import { Message } from "./Message";
import { TurningPointDetectorConfig } from "./types";
/**
* Defines the formatting style for replaced headings.
* - 'plain': Just the heading text (removes '#' markers only).
* - 'bold': Surrounds the heading text with '**'.
* - 'italic': Surrounds the heading text with '*'.
* - 'bold-italic': Surrounds the heading text with '***'.
* - 'prefix': Prepends a specific string (defined in `headingPrefix`) to the heading text.
*/
export type HeadingStyle = 'plain' | 'bold' | 'italic' | 'bold-italic' | 'prefix';
/**
* Configuration options for selectivelyStripMarkdown function.
*/
export type StripMarkdownOptions = {
/**
* If true, removes list markers (*, -, +, 1.) while keeping the item text.
* @default false
*/
removeLists?: boolean;
/**
* Defines how heading syntax (#) should be replaced.
* @default 'bold'
*/
headingStyle?: HeadingStyle;
/**
* The prefix string to use when `headingStyle` is 'prefix'.
* @default 'heading: '
*/
headingPrefix?: string;
};
/**
* Selectively removes or reformats Markdown elements like headings and optionally lists.
* Headings (#) are replaced based on the specified `headingStyle`.
* Lists (*, -, +, 1.) can optionally be stripped to plain text (controlled by `removeLists`).
* Content remains on the same line, and overall newlines are preserved.
*
* @param markdown The input Markdown string.
* @param options Configuration options for stripping and formatting.
* @returns The processed string.
*/
export declare function selectivelyStripMarkdown(markdown: string, options?: StripMarkdownOptions): string;
/**
* A helper function that formats a given message in a form that ensures the content is not long and easily distinguishable as part of contextual information when requesting a llm or nlp model to process it.
* @param semanticSettings
* @param m
* @param dimension
* @param addHeader
* @param sliceId
* @returns
*/
export declare function returnFormattedMessageContent(semanticSettings: Partial<TurningPointDetectorConfig>, m: Message, dimension?: number, addHeader?: boolean, sliceId?: boolean): string;
//# sourceMappingURL=stripContent.d.ts.map