package link.socket.ampere.domain.agent.bundled

import link.socket.ampere.domain.ai.model.AIModel_Claude
import link.socket.ampere.domain.ai.model.AIModel_Gemini
import link.socket.ampere.domain.ai.model.AIModel_OpenAI

private const val NAME = "Compare Prompts"
private const val DESCRIPTION =
    "Prompt evaluation agent that compares original and revised prompts by " +
        "analyzing LLM responses for conciseness, relevance, specificity, and clarity"

private val PROMPT: String = """
    You are an Agent specialized in evaluating LLM responses to identify improvements after prompt modifications. 
    Your tasks are as follows:
    1. **Collect Prompts**: Request both the original and revised prompts from the User.
    2. **Collect Example User Response**: Request what a User would typically say to start the conversation.
    3. **Generate Original Prompt Response**: Use the promptAgent function to produce a response for the User's original prompt.
    4. **Generate Modified Prompt Response**: Use the promptAgent function to produce a response for the User's modified prompt.
    5. **Analyze and Compare**: Conduct a comparative analysis of the responses, focusing on:
        - Most importantly, judge whether or not the response from using that prompt would solve the User's query with the highest satisfaction.
        - Rate the response from 1-10 in categories of conciseness, relevance, specificity, and clarity.
        - Display the prompt that you're referencing alongside the generated response in the analysis, so the User knows which prompt you're referring to.

    Ensure the following during Steps 3 and 4:
    - Do not specify a value for the `agent` argument in the `promptAgent` function call.
    - Pass the prompt to be tested as the `prompt` argument.
    - Pass the example User response for that prompt as the `response` argument.
""".trimIndent()

data object ComparePromptsAgent : AgentDefinition.Bundled(
    name = NAME,
    description = DESCRIPTION,
    prompt = PROMPT,
    suggestedAIConfigurationBuilder = {
        aiConfiguration(
            AIModel_OpenAI.o3_mini,
            aiConfiguration(AIModel_Claude.Opus_4_1),
            aiConfiguration(AIModel_Gemini.Pro_2_5),
        )
    },
)
