@yogesh0333/yogiway-prompt
Version:
Free & Open Source Prompt Optimization Library - Save 30-50% on AI API costs. Multi-language, multi-platform support.
23 lines (22 loc) • 776 B
TypeScript
/**
* Semantic-Aware Optimization
* Uses pattern matching and context understanding for better optimization
*/
export interface SemanticContext {
intent: 'instruction' | 'question' | 'description' | 'conversation' | 'code';
urgency: 'low' | 'medium' | 'high';
formality: 'casual' | 'neutral' | 'formal';
}
/**
* Detect semantic context from text
*/
export declare function detectSemanticContext(text: string): SemanticContext;
/**
* Semantic-aware optimization
* Preserves meaning while optimizing based on context
*/
export declare function semanticOptimize(text: string, context?: SemanticContext): string;
/**
* Apply semantic patterns based on context
*/
export declare function applySemanticPatterns(text: string, context: SemanticContext): string;