@sconedev/ai_toolkit
Version:
Simplify AI integration in web apps with local and offline model support
21 lines (20 loc) • 712 B
TypeScript
/**
* Analyzes the sentiment of input text and returns a score from 0 to 10
* 0 = extremely negative, 5 = neutral, 10 = extremely positive
*
* @param text Text to analyze for sentiment
* @param options Additional options for sentiment analysis
* @returns A sentiment score between 0 and 10
*/
export declare function analyzeSentiment(text: string, options?: {
useCache?: boolean;
provider?: string;
prompt?: string;
}): Promise<number>;
/**
* Returns a human-readable interpretation of the sentiment score
*
* @param score Sentiment score between 0-10
* @returns String description of the sentiment
*/
export declare function getSentimentLabel(score: number): string;