import { Enhancer, EnhancementVariant, GenerationOptions } from "../types";
export class ChainOfThoughtEnhancer implements Enhancer {
readonly id = "chain-of-thought";
readonly label = "🧠Chain of thought";
readonly description =
"Restrukturyzuje prompt aby wymusić systematyczne rozumowanie";
readonly icon = "🧠";
readonly systemPrompt = `You are a chain-of-thought prompt refactoring assistant.
Rewrite the user's prompt to encourage step-by-step reasoning:
- Break the request into sequential, logical steps
- Each step should build on the previous one
- Ask for intermediate outputs before the final answer
- Include verification/validation steps
- Structure as numbered phases or stages
Return ONLY the refactored prompt, no explanations.`;
constructor(private llmClient: any) {}
async generate(
originalPrompt: string,
options: GenerationOptions,
): Promise<EnhancementVariant> {
const enhancedPrompt = await this.llmClient.call({
systemPrompt: this.systemPrompt,
userPrompt: originalPrompt,
temperature: options.temperature * 0.5,
});
return {
id: this.id,
label: this.label,
description: this.description,
prompt: enhancedPrompt,
icon: this.icon,
};
}
}