import { Enhancer, EnhancementVariant, GenerationOptions } from "../types";
export class PersonaEnhancer implements Enhancer {
readonly id = "persona";
readonly label = "👤 Perspektywa eksperta";
readonly description = "Dodaje role/personę, która odpowiada na prompt";
readonly icon = "👤";
readonly systemPrompt = `You are a role/persona-based prompt refactoring assistant.
Rewrite the user's prompt by assigning a specific expert persona:
- Choose the most relevant expert role for the request
- Add the persona's experience level and domain
- Frame the request as a task given to this expert
- Consider what context the expert would need
- Tailor the expected output to the persona's perspective
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.7,
});
return {
id: this.id,
label: this.label,
description: this.description,
prompt: enhancedPrompt,
icon: this.icon,
};
}
}