
MEETING_MINUTES_PROMPT = """
You are a professional assistant specialized in summarizing meeting transcripts.
Your task is to create a formal and structured protocol (Meeting Minutes) from the provided transcript.

Please analyze the following transcript and generate the Meeting Minutes in German.

**Transcript:**
---
{transcript_text}
---

**Instructions for the Meeting Minutes:**

1.  **Header:**
    *   Start with a clear title: "Meeting-Protokoll".
    *   Add a placeholder for the meeting date: "Datum: [Datum des Meetings]".

2.  **Agenda Items:**
    *   Identify the main topics discussed.
    *   Structure the protocol using these topics as headlines (e.g., "Tagesordnungspunkt 1: [Thema]").

3.  **Key Discussions & Decisions:**
    *   For each agenda item, summarize the key points of the discussion.
    *   Clearly list all decisions that were made. Use a format like "**Entscheidung:** ...".

4.  **Action Items (Next Steps):**
    *   Extract all clear tasks or action items.
    *   For each action item, identify the responsible person (Owner) and the deadline, if mentioned.
    *   Present the action items in a clear list under a headline "Nächste Schritte / Action Items". Use the format: "- [Aufgabe] (Verantwortlich: [Person], Fällig bis: [Datum/unbestimmt])".

5.  **General Tone & Language:**
    *   The protocol must be written in formal, professional German.
    *   Be concise and focus on the essential information (discussions, decisions, tasks).
    *   Do not invent information that is not present in the transcript.

Please provide the output in Markdown format.
"""

ACTION_ITEMS_PROMPT = """
You are a highly efficient assistant focused on productivity and task management.
Your goal is to extract all actionable tasks (Action Items) from a meeting transcript.

Please analyze the following transcript and list all tasks.

**Transcript:**
---
{transcript_text}
---

**Instructions for the Action Item List:**

1.  **Extraction:**
    *   Carefully read the entire transcript and identify every statement that constitutes a task, a to-do, or a commitment to do something.
    *   Ignore general discussions, opinions, and status updates. Focus only on future actions.

2.  **Format:**
    *   Present the extracted tasks as a bulleted list.
    *   For each task, clearly state:
        *   **What** needs to be done.
        *   **Who** is responsible for it (Owner).
        *   **When** it should be completed by (Due Date), if mentioned.

3.  **Output Structure:**
    *   Use the following format for each item: `- [Task Description] (Owner: [Person's Name], Due: [Date/unspecified])`
    *   If the owner or due date is not explicitly mentioned, use "[unbestimmt]".
    *   The list should be titled "Action Item Liste".

4.  **Language:**
    *   The output should be in German.

Please provide the output in Markdown format.
"""

SALES_SUMMARY_PROMPT = """
You are a Senior Sales Manager analyzing a meeting transcript from a client conversation.
Your objective is to create a concise, rollenbasierte Zusammenfassung for the sales team. The summary should highlight key information relevant to closing a deal.

Please analyze the following transcript and generate a Sales Summary.

**Transcript:**
---
{transcript_text}
---

**Instructions for the Sales Summary:**

1.  **Customer Needs & Pain Points:**
    *   Identify and list the core problems, challenges, and needs expressed by the client.
    *   What are their primary business goals?

2.  **Buying Signals:**
    *   Extract any phrases or questions that indicate a strong interest in the product/service (e.g., questions about price, implementation, specific features).

3.  **Key Decision-Makers:**
    *   Identify the people in the meeting who seem to have the most influence on the purchasing decision. Note their role or title if mentioned.

4.  **Budget & Timeline:**
    *   Note any mentions of budget, pricing expectations, or the timeline for their decision-making process.

5.  **Next Steps (from a Sales Perspective):**
    *   What are the immediate next actions the sales team needs to take to move this deal forward? (e.g., "Send proposal," "Schedule demo for the technical team").

**Output Format:**
*   Use clear headings for each section (e.g., "Kundenbedürfnisse & Pain Points", "Kaufsignale").
*   Use bullet points for lists.
*   The language should be direct, actionable, and in German.

Please provide the output in Markdown format.
"""

# You can add more prompts here for other analysis types.
# For example, a prompt for a technical summary, a marketing summary, etc.

TRANSLATE_TRANSCRIPT_PROMPT = """
You are a highly accurate and fluent translator.
Your task is to translate the given meeting transcript into {target_language}.
Maintain the original format (who said what) as closely as possible.

**Transcript:**
---
{transcript}
---

**Output:**
Provide only the translated text. Do not add any commentary or additional formatting.
"""

_PROMPTS = {
    "meeting_minutes": MEETING_MINUTES_PROMPT,
    "action_items": ACTION_ITEMS_PROMPT,
    "sales_summary": SALES_SUMMARY_PROMPT,
    "translate_transcript": TRANSLATE_TRANSCRIPT_PROMPT,
}

def get_prompt(prompt_type: str, context: dict = None) -> str:
    """
    Retrieves a prompt by its type and formats it with the given context.
    """
    prompt_template = _PROMPTS.get(prompt_type)
    if not prompt_template:
        raise ValueError(f"Unknown prompt type: {prompt_type}")
    
    if context:
        return prompt_template.format(**context)
    
    return prompt_template

