Skip to content
TheChatArchiveThe Chat Archive
gpt-4.1-mini-2025-04-14· OpenAIAi2 WildChat-4.8M (AI2)

this is an sample example from agents.baseagent import BaseAgent class…

  1. User

    this is an sample example from agents.base_agent import BaseAgent

    class ConsumerHealthAgent(BaseAgent): prompt_sys = "Consumer health and macroeconomic analyst for Macy's, tasked with analyzing provided documents regarding consumer financial health and macro environment."

    # Universal formatting enforcement line (adapted and extended where necessary)
    formatting_directive = """Please strictly follow these formatting guidelines for all numerical mentions and sentence structures:
    
    1. No Combined Elements: Always space-separate numbers, words, and units (e.g., "3.3 billion" not "3.3billion").
    2. Time Formatting: Use formats like "Q4 2024" (never "Q42024" or "4th quarter").
    3. Number Rules:
      • 3.3B → 3.3 billion
      • 150.2M → 150.2 million
      • 0.33 → keep exact decimal
    4. Text Integrity:
      • "net income" never "netincome"
      • "year-over-year" never "YOY" or "yearoveryear"
      • "YOY " never "year-over-year" or "yearoveryear"
      • "vs." never "versus" or "vs"
      • "XB"never"XB" never "X billion"
      • "XM"never"XM" never "X million"
    5. Style Prohibition: Do not italicize or alter text formatting; maintain a single plain format throughout.
    6. Bad Example: 3.3billioninQ42024,withanadjustednetincomeof,106million,withadjustedearningsperdilutedshareat0.95 → REJECTED
    7. ALWAYS Required Format: 3.3 billion in Q4 2024, with an adjusted net income of → ACCEPTED

    APPLY THESE RULES TO ALL NUMERICAL MENTIONS AND SENTENCE STRUCTURES."""

    prompt_analyze = (
        "You are a senior business analyst working directly for Macy's CEO. Analyze the provided earnings call transcript and summarize mentions "
        "of consumer financial health and the macroeconomic environment.\n\n"
        "Identify key topics including but not limited to:\n"
        "- US consumer\n"
        "- The company’s customer\n"
        "- Change in demand\n"
        "- Change in spend\n\n"
        "For each topic, provide:\n"
        "- A clear topic name (e.g., \"E-commerce Growth\", \"Supply Chain Digitization\")\n"
        "- Concise 100-word summary providing key numbers and operational impacts\n"
        "- Strictly preserve original numerical and textual formatting: maintain exact decimals (0.33), required spacing (0.11 → '0.11'), and verbatim terminology without concatenation or rephrasing.\n"
        "- For every topic, ALWAYS provide excerpts mentioned under the heading \"Ground Truth\" as follows:\n"
        "      - For each document where the topic appears, extract the exact, unmodified sentence(s) or paragraph(s) from the original document.\n"
        "      - Format each excerpt as: **Ground Truth:** \"Exact text from the document...\" (Document Name)\n"
        "      - If a topic is present in multiple documents, include a separate \"Ground Truth\" excerpt for each document.\n"
        "      - Do NOT paraphrase, summarize, or alter the original text in any way. The excerpt must match the document data exactly, including all formatting, punctuation, and special characters.\n"
        "      - If the LLM cannot find an exact match in the document, do NOT fabricate or modify the excerpt—only include what is present in the documents.\n\n"
        "Format each topic as:\n"
        "- Topic Name: Summary [Relevance Score]\n\n"
        "Example:\n"
        "- Holiday Sales Performance: Q4 comparable sales up 4.2% driven by 18% digital growth [8]\n"
        "- Inventory Optimization: Implementing AI demand forecasting to reduce carrying costs by $150M [7]\n\n"
        "Document Text: " + formatting_directive
    )
    
    prompt_summary = (
        "You are a senior analyst preparing a summary of transcript commentary from all documents provided.\n"
        "Identify and describe all mentions of consumer financial health and the macroeconomic environment in the provided documents, "
        "focusing on what the company says about the US consumer, their customer, a change in demand, or a change in spend. Combine and synthesize topics that appear in multiple documents.\n\n"
        "1. **Overview**: Identify and describe all mentions of consumer financial health and the macroeconomic environment in the provided documents.\n\n"
        "2. For each topic:\n"
        "    * Provide a concise summary by combining information from all relevant documents.\n"
        "    * Include relevant examples, numerical data, or timelines from the documents.\n"
        "    * For every topic, ALWAYS provide each excerpt mentioned under the heading \"Ground Truth\" as follows:\n"
        "        - For each document where the topic appears, extract the exact, unmodified sentence(s) or paragraph(s) from the original document.\n"
        "        - Format each excerpt as: **Ground Truth:** \"Exact text from the document...\" (Document Name)\n"
        "        - If the same topic is present in multiple documents, always include a separate \"Ground Truth\" excerpt for each document with proper line breaks.\n"
        "        - Do NOT paraphrase, summarize, or alter the original text in any way. The excerpt must match the documents data exactly, including all formatting, punctuation, and special characters.\n"
        "        - If the LLM cannot find an exact match in the document, do NOT fabricate or modify the excerpt—only include what is present in the document.\n\n"
        "3. Format with clear sections in plain black text with proper headings:\n"
        "    * Consumer Health Summary\n\n"
        "Use the following Documents Analysis Data to combine similar topics from different documents and provide a comprehensive summary:\n"
        "{topics_block}\n\n"
        "Provide a comprehensive yet concise summary. STRICTLY ENFORCE PLAIN TEXT FORMATTING:\n"
        + formatting_directive
    )
    
    prompt_detail = (
        "You are preparing a detailed briefing for Macy's CEO on the consumer health topic '{topic}', based on the external company document.\n\n"
        "Provide:\n"
        "1. Overview of the topic.\n"
        "2. Key insights and relevant excerpts.\n"
        "3. Important figures, timelines, or operational metrics.\n"
        "4. Detailed analysis of the impact on Macy's consumer health outlook and macroeconomic environment.\n"
        "5. For every topic, ALWAYS provide verbatim source excerpts under the heading \"Ground Truth\" as follows:\n"
        "      - For each document where the topic appears, extract the exact, unmodified sentence(s) or paragraph(s) from the original document.\n"
        "      - Format each excerpt as: **Ground Truth:** \"Exact text from the document...\" (Document Name)\n"
        "      - If a topic is present in multiple documents, include a separate \"Ground Truth\" excerpt for each document.\n"
        "      - Do NOT paraphrase, summarize, or alter the original text in any way. The excerpt must match the source exactly, including all formatting, punctuation, and special characters.\n"
        "      - If the LLM cannot find an exact match in the document, do NOT fabricate or modify the excerpt—only include what is present in the source.\n\n"
        "Document:\n"
        "{text}\n\n"
        "Topic: {topic}\n\n"
        "Please provide a structured briefing with proper paragraphs and bold topics.\n"
        + formatting_directive
    )
    
    def analyze_document(self, text, custom_prompt=None):
        prompt_analyze = custom_prompt if custom_prompt else self.prompt_analyze
        return super().analyze_document(self.prompt_sys, prompt_analyze, text)
    
    def generate_consolidated_summary_from_topics(self, processed_files, custom_prompt=None):
        prompt_summary = custom_prompt if custom_prompt else self.prompt_summary
        return super().generate_consolidated_summary_from_topics(self.prompt_sys, prompt_summary, processed_files)
    
    def generate_topic_detail(self, text, topic, custom_prompt=None):
        prompt_detail = custom_prompt if custom_prompt else self.prompt_detail
        return super().generate_topic_detail(self.prompt_sys, prompt_detail, text, topic)
    

    as per this same file we need to create for the FY25ExpectationsAgent and the prompts inside it is like below

    FY25 Expectations Prompt: Summarize how management qualitatively spoke to its financial expectations for the current year. In a separate paragraph, list the financial guidance they provided for the year and next quarter. If they did not provide financial guidance, say “The company did not provide specific financial guidance within its earnings call”.

  2. Assistant

    Based on your example for ConsumerHealthAgent, here is a code skeleton for FY25ExpectationsAgent that follows the same structure, style, formatting rules, and method patterns, but with prompts tailored according to your FY25 Expectations description.

    from agents.base_agent import BaseAgent
    
    class FY25ExpectationsAgent(BaseAgent):
        prompt_sys = "Financial analyst focused on Macy's FY25 management expectations, tasked with analyzing provided documents pertaining to management's qualitative commentary and financial guidance for FY25 and upcoming quarters."
    
        # Reuse the same universal formatting directive, adapting if needed
        formatting_directive = """Please strictly follow these formatting guidelines for all numerical mentions and sentence structures:
    1. **No Combined Elements**: Always space-separate numbers, words, and units (e.g., "3.3 billion" not "3.3billion").
    2. **Time Formatting**: Use formats like "Q4 2024" (never "Q42024" or "4th quarter").
    3. **Number Rules**:  
       - 3.3B → 3.3 billion  
       - 150.2M → 150.2 million  
       - 0.33 → keep exact decimal  
    4. **Text Integrity**:  
       - "net income" never "netincome"  
       - "year-over-year" never "YOY" or "yearoveryear"  
       - "YOY " never "year-over-year" or "yearoveryear"  
       - "vs." never "versus" or "vs"  
       - "$XB" never "$X billion"  
       - "$XM" never "$X million"  
    5. **Style Prohibition**: Do not italicize or alter text formatting; maintain a single plain format throughout.
    6. **Bad Example**: `3.3billioninQ42024,withanadjustednetincomeof,106million,withadjustedearningsperdilutedshareat0.95` → REJECTED
    7. **ALWAYS Required Format**: `3.3 billion in Q4 2024, with an adjusted net income of` → ACCEPTED
    
    APPLY THESE RULES TO ALL NUMERICAL MENTIONS AND SENTENCE STRUCTURES."""
    
        prompt_analyze = (
            "You are a senior financial analyst working directly for Macy's CEO. Analyze the provided earnings call transcript and summarize, "
            "in plain text, how management qualitatively spoke to its financial expectations for fiscal year 2025.\n\n"
            "Then, in a separate paragraph, list the financial guidance management provided for FY25 and the next quarter. If no financial guidance was provided, "
            "state clearly: “The company did not provide specific financial guidance within its earnings call.”\n\n"
            "For every statement, STRICTLY preserve original numerical and textual formatting, including spacing and decimals, following these rules:\n"
            + formatting_directive + "\n\n"
            "For every relevant excerpt, ALWAYS provide verbatim source excerpts under the heading \"Ground Truth\" as follows:\n"
            "- Extract exact, unmodified sentence(s) or paragraphs from the original document.\n"
            "- Format each excerpt as: **Ground Truth:** \"Exact text from the document...\" (Document Name)\n"
            "- For multiple documents, include separate excerpts for each.\n"
            "- Do NOT paraphrase, summarize, or alter the original text.\n"
            "- Do NOT fabricate or add excerpts not in the document.\n\n"
            "Format your output as two paragraphs: first on qualitative expectations, second on financial guidance, followed by all relevant \"Ground Truth\" excerpts."
        )
    
        prompt_summary = (
            "You are a senior analyst preparing a comprehensive summary on Macy's FY25 management expectations from all provided documents.\n"
            "Summarize how management qualitatively described their financial outlook for FY25, followed by a clear list of any financial guidance for FY25 and the next quarter.\n"
            "If no guidance was provided, explicitly say: “The company did not provide specific financial guidance within its earnings call.”\n\n"
            "For each summarized element, ALWAYS include verbatim excerpts under the heading \"Ground Truth\" as follows:\n"
            "- Extract exact, unmodified sentence(s) or paragraphs from the original documents.\n"
            "- Format as: **Ground Truth:** \"Exact text from the document...\" (Document Name)\n"
            "- Include all document excerpts separately if the topic appears multiple times.\n"
            "- Do NOT paraphrase or fabricate.\n\n"
            "Use proper plain text formatting and the following numerical/textual formatting rules:\n"
            + formatting_directive
        )
    
        prompt_detail = (
            "You are preparing a detailed briefing for Macy's CEO on the FY25 financial expectations topic '{topic}', based on the external company document.\n\n"
            "Provide:\n"
            "1. Overview of management’s qualitative financial expectations for FY25.\n"
            "2. Specific financial guidance details for FY25 and the next quarter if provided.\n"
            "3. Relevant figures, timelines, or operational metrics mentioned.\n"
            "4. Analysis on the impact of these expectations on Macy’s overall financial outlook.\n"
            "5. For every point, ALWAYS provide verbatim source excerpts under the heading \"Ground Truth\" as follows:\n"
            "      - Extract exact, unmodified sentences or paragraphs from the original documents.\n"
            "      - Format each excerpt as: **Ground Truth:** \"Exact text from the document...\" (Document Name)\n"
            "      - Include separate excerpts for multiple documents if applicable.\n"
            "      - Do NOT paraphrase, summarize, or alter the original text.\n"
            "      - Do NOT fabricate excerpts.\n\n"
            "Document:\n"
            "{text}\n\n"
            "Topic: {topic}\n\n"
            "Please provide a structured, clear briefing with proper paragraphs and bolded section titles.\n"
            + formatting_directive
        )
    
        def analyze_document(self, text, custom_prompt=None):
            prompt = custom_prompt if custom_prompt else self.prompt_analyze
            return super().analyze_document(self.prompt_sys, prompt, text)
    
        def generate_consolidated_summary_from_topics(self, processed_files, custom_prompt=None):
            prompt = custom_prompt if custom_prompt else self.prompt_summary
            return super().generate_consolidated_summary_from_topics(self.prompt_sys, prompt, processed_files)
    
        def generate_topic_detail(self, text, topic, custom_prompt=None):
            prompt = custom_prompt if custom_prompt else self.prompt_detail
            return super().generate_topic_detail(self.prompt_sys, prompt, text, topic)
    

    Explanation of the key points:

    • The prompt_sys describes the role and scope precisely.
    • All prompts reference the same universal strict formatting directive from your original file.
    • The prompts follow the style of the ConsumerHealthAgent prompts but focus on qualitative financial expectations and explicit financial guidance.
    • The prompts explicitly require verbatim "Ground Truth" excerpts with clear formatting instructions.
    • The class methods mirror those of your ConsumerHealthAgent, enabling coherent integration in your system.

    Let me know if you'd like the prompt text customized further or integrated into your project with other features!

  3. User

    this is an sample example from agents.base_agent import BaseAgent

    class ConsumerHealthAgent(BaseAgent): prompt_sys = "Consumer health and macroeconomic analyst for Macy's, tasked with analyzing provided documents regarding consumer financial health and macro environment."

    # Universal formatting enforcement line (adapted and extended where necessary)
    formatting_directive = """Please strictly follow these formatting guidelines for all numerical mentions and sentence structures:
    
    1. No Combined Elements: Always space-separate numbers, words, and units (e.g., "3.3 billion" not "3.3billion").
    2. Time Formatting: Use formats like "Q4 2024" (never "Q42024" or "4th quarter").
    3. Number Rules:
      • 3.3B → 3.3 billion
      • 150.2M → 150.2 million
      • 0.33 → keep exact decimal
    4. Text Integrity:
      • "net income" never "netincome"
      • "year-over-year" never "YOY" or "yearoveryear"
      • "YOY " never "year-over-year" or "yearoveryear"
      • "vs." never "versus" or "vs"
      • "XB"never"XB" never "X billion"
      • "XM"never"XM" never "X million"
    5. Style Prohibition: Do not italicize or alter text formatting; maintain a single plain format throughout.
    6. Bad Example: 3.3billioninQ42024,withanadjustednetincomeof,106million,withadjustedearningsperdilutedshareat0.95 → REJECTED
    7. ALWAYS Required Format: 3.3 billion in Q4 2024, with an adjusted net income of → ACCEPTED

    APPLY THESE RULES TO ALL NUMERICAL MENTIONS AND SENTENCE STRUCTURES."""

    prompt_analyze = (
        "You are a senior business analyst working directly for Macy's CEO. Analyze the provided earnings call transcript and summarize mentions "
        "of consumer financial health and the macroeconomic environment.\n\n"
        "Identify key topics including but not limited to:\n"
        "- US consumer\n"
        "- The company’s customer\n"
        "- Change in demand\n"
        "- Change in spend\n\n"
        "For each topic, provide:\n"
        "- A clear topic name (e.g., \"E-commerce Growth\", \"Supply Chain Digitization\")\n"
        "- Concise 100-word summary providing key numbers and operational impacts\n"
        "- Strictly preserve original numerical and textual formatting: maintain exact decimals (0.33), required spacing (0.11 → '0.11'), and verbatim terminology without concatenation or rephrasing.\n"
        "- For every topic, ALWAYS provide excerpts mentioned under the heading \"Ground Truth\" as follows:\n"
        "      - For each document where the topic appears, extract the exact, unmodified sentence(s) or paragraph(s) from the original document.\n"
        "      - Format each excerpt as: **Ground Truth:** \"Exact text from the document...\" (Document Name)\n"
        "      - If a topic is present in multiple documents, include a separate \"Ground Truth\" excerpt for each document.\n"
        "      - Do NOT paraphrase, summarize, or alter the original text in any way. The excerpt must match the document data exactly, including all formatting, punctuation, and special characters.\n"
        "      - If the LLM cannot find an exact match in the document, do NOT fabricate or modify the excerpt—only include what is present in the documents.\n\n"
        "Format each topic as:\n"
        "- Topic Name: Summary [Relevance Score]\n\n"
        "Example:\n"
        "- Holiday Sales Performance: Q4 comparable sales up 4.2% driven by 18% digital growth [8]\n"
        "- Inventory Optimization: Implementing AI demand forecasting to reduce carrying costs by $150M [7]\n\n"
        "Document Text: " + formatting_directive
    )
    
    prompt_summary = (
        "You are a senior analyst preparing a summary of transcript commentary from all documents provided.\n"
        "Identify and describe all mentions of consumer financial health and the macroeconomic environment in the provided documents, "
        "focusing on what the company says about the US consumer, their customer, a change in demand, or a change in spend. Combine and synthesize topics that appear in multiple documents.\n\n"
        "1. **Overview**: Identify and describe all mentions of consumer financial health and the macroeconomic environment in the provided documents.\n\n"
        "2. For each topic:\n"
        "    * Provide a concise summary by combining information from all relevant documents.\n"
        "    * Include relevant examples, numerical data, or timelines from the documents.\n"
        "    * For every topic, ALWAYS provide each excerpt mentioned under the heading \"Ground Truth\" as follows:\n"
        "        - For each document where the topic appears, extract the exact, unmodified sentence(s) or paragraph(s) from the original document.\n"
        "        - Format each excerpt as: **Ground Truth:** \"Exact text from the document...\" (Document Name)\n"
        "        - If the same topic is present in multiple documents, always include a separate \"Ground Truth\" excerpt for each document with proper line breaks.\n"
        "        - Do NOT paraphrase, summarize, or alter the original text in any way. The excerpt must match the documents data exactly, including all formatting, punctuation, and special characters.\n"
        "        - If the LLM cannot find an exact match in the document, do NOT fabricate or modify the excerpt—only include what is present in the document.\n\n"
        "3. Format with clear sections in plain black text with proper headings:\n"
        "    * Consumer Health Summary\n\n"
        "Use the following Documents Analysis Data to combine similar topics from different documents and provide a comprehensive summary:\n"
        "{topics_block}\n\n"
        "Provide a comprehensive yet concise summary. STRICTLY ENFORCE PLAIN TEXT FORMATTING:\n"
        + formatting_directive
    )
    
    prompt_detail = (
        "You are preparing a detailed briefing for Macy's CEO on the consumer health topic '{topic}', based on the external company document.\n\n"
        "Provide:\n"
        "1. Overview of the topic.\n"
        "2. Key insights and relevant excerpts.\n"
        "3. Important figures, timelines, or operational metrics.\n"
        "4. Detailed analysis of the impact on Macy's consumer health outlook and macroeconomic environment.\n"
        "5. For every topic, ALWAYS provide verbatim source excerpts under the heading \"Ground Truth\" as follows:\n"
        "      - For each document where the topic appears, extract the exact, unmodified sentence(s) or paragraph(s) from the original document.\n"
        "      - Format each excerpt as: **Ground Truth:** \"Exact text from the document...\" (Document Name)\n"
        "      - If a topic is present in multiple documents, include a separate \"Ground Truth\" excerpt for each document.\n"
        "      - Do NOT paraphrase, summarize, or alter the original text in any way. The excerpt must match the source exactly, including all formatting, punctuation, and special characters.\n"
        "      - If the LLM cannot find an exact match in the document, do NOT fabricate or modify the excerpt—only include what is present in the source.\n\n"
        "Document:\n"
        "{text}\n\n"
        "Topic: {topic}\n\n"
        "Please provide a structured briefing with proper paragraphs and bold topics.\n"
        + formatting_directive
    )
    
    def analyze_document(self, text, custom_prompt=None):
        prompt_analyze = custom_prompt if custom_prompt else self.prompt_analyze
        return super().analyze_document(self.prompt_sys, prompt_analyze, text)
    
    def generate_consolidated_summary_from_topics(self, processed_files, custom_prompt=None):
        prompt_summary = custom_prompt if custom_prompt else self.prompt_summary
        return super().generate_consolidated_summary_from_topics(self.prompt_sys, prompt_summary, processed_files)
    
    def generate_topic_detail(self, text, topic, custom_prompt=None):
        prompt_detail = custom_prompt if custom_prompt else self.prompt_detail
        return super().generate_topic_detail(self.prompt_sys, prompt_detail, text, topic)
    

    as per this same file we need to create for the GeopoliticalUncertaintyAgent and the prompts inside it is like below

    Global Supply Chain / Geopolitical Uncertainty Prompt: Provide what the company said regarding impacts to its supply chain due to geopolitical or macroeconomic circumstances. If no detail is provided, say “N/A”.

  4. Assistant

    Certainly! Below is a fully structured GeopoliticalUncertaintyAgent Python class modeled on your ConsumerHealthAgent example, with prompts adapted to your requirements about "Global Supply Chain / Geopolitical Uncertainty":

    from agents.base_agent import BaseAgent
    
    class GeopoliticalUncertaintyAgent(BaseAgent):
        prompt_sys = (
            "Analyst focused on Macy's global supply chain and geopolitical uncertainty, "
            "tasked with analyzing provided documents about any impacts or risks to the supply chain "
            "stemming from geopolitical or macroeconomic circumstances."
        )
    
        # Universal formatting enforcement line exactly matching ConsumerHealthAgent
        formatting_directive = """Please strictly follow these formatting guidelines for all numerical mentions and sentence structures:
    1. **No Combined Elements**: Always space-separate numbers, words, and units (e.g., "3.3 billion" not "3.3billion").
    2. **Time Formatting**: Use formats like "Q4 2024" (never "Q42024" or "4th quarter").
    3. **Number Rules**:  
       - 3.3B → 3.3 billion  
       - 150.2M → 150.2 million  
       - 0.33 → keep exact decimal  
    4. **Text Integrity**:  
       - "net income" never "netincome"  
       - "year-over-year" never "YOY" or "yearoveryear"  
       - "YOY " never "year-over-year" or "yearoveryear"  
       - "vs." never "versus" or "vs"  
       - "$XB" never "$X billion"  
       - "$XM" never "$X million"  
    5. **Style Prohibition**: Do not italicize or alter text formatting; maintain a single plain format throughout.
    6. **Bad Example**: `3.3billioninQ42024,withanadjustednetincomeof,106million,withadjustedearningsperdilutedshareat0.95` → REJECTED
    7. **ALWAYS Required Format**: `3.3 billion in Q4 2024, with an adjusted net income of` → ACCEPTED
    
    APPLY THESE RULES TO ALL NUMERICAL MENTIONS AND SENTENCE STRUCTURES."""
    
        prompt_analyze = (
            "You are a senior supply chain analyst supporting Macy's CEO. Analyze the provided earnings call transcript and identify all references "
            "to the impacts on Macy's supply chain due to geopolitical or macroeconomic circumstances.\n\n"
            "If no such impacts or risks are mentioned, respond with \"N/A\".\n\n"
            "For all findings:\n"
            "- Strictly preserve original numerical and textual formatting, including spacing and exact decimals.\n"
            "- For every mention, ALWAYS provide verbatim excerpts under the heading \"Ground Truth\" as follows:\n"
            "   - Extract exact, unmodified sentence(s) or paragraph(s) from the original document.\n"
            "   - Format each excerpt as: **Ground Truth:** \"Exact text from the document...\" (Document Name)\n"
            "   - If the same topic appears in multiple documents, provide separate \"Ground Truth\" excerpts for each.\n"
            "   - Do NOT paraphrase, summarize, or alter the original text.\n"
            "   - Do NOT fabricate excerpts.\n\n"
            "Format your output clearly, providing a brief summary of supply chain impacts or \"N/A\" if none.\n\n"
            "Document Text: " + formatting_directive
        )
    
        prompt_summary = (
            "You are a senior analyst compiling a summary of Macy's statements regarding supply chain impacts from geopolitical or macroeconomic risks across all provided documents.\n\n"
            "For each document:\n"
            "- Summarize any mentions of supply chain disruptions, delays, or risks linked to geopolitical or macroeconomic conditions.\n"
            "- If no mentions exist, state \"N/A\" for that document.\n"
            "- For every mention, ALWAYS provide verbatim excerpts under the heading \"Ground Truth\" formatted as:\n"
            "  **Ground Truth:** \"Exact text from the document...\" (Document Name)\n"
            "- Do NOT paraphrase or fabricate excerpts.\n\n"
            "Combine and synthesize these mentions into a comprehensive summary.\n\n"
            "STRICTLY apply the following formatting rules:\n"
            + formatting_directive
        )
    
        prompt_detail = (
            "You are preparing a detailed briefing for Macy's CEO on the supply chain topic '{topic}', based on provided external documents focusing on geopolitical or macroeconomic uncertainties.\n\n"
            "Provide:\n"
            "1. Overview of any stated supply chain impacts or risks due to geopolitical or macroeconomic factors.\n"
            "2. Specific details or figures if provided.\n"
            "3. Timeline and operational implications if mentioned.\n"
            "4. Analysis of the broader impact on Macy's supply chain resilience and operations.\n"
            "5. For all points, ALWAYS include verbatim source excerpts under the heading \"Ground Truth\" as follows:\n"
            "    - Extract exact, unmodified sentences or paragraphs from the original document(s).\n"
            "    - Format excerpts as: **Ground Truth:** \"Exact text from the document...\" (Document Name)\n"
            "    - Provide separate excerpts if multiple documents cover the topic.\n"
            "    - Do NOT alter, paraphrase, or fabricate source content.\n\n"
            "Document:\n"
            "{text}\n\n"
            "Topic: {topic}\n\n"
            "Provide a structured, professional briefing with clear paragraphs and bold headings.\n"
            + formatting_directive
        )
    
        def analyze_document(self, text, custom_prompt=None):
            prompt = custom_prompt if custom_prompt else self.prompt_analyze
            return super().analyze_document(self.prompt_sys, prompt, text)
    
        def generate_consolidated_summary_from_topics(self, processed_files, custom_prompt=None):
            prompt = custom_prompt if custom_prompt else self.prompt_summary
            return super().generate_consolidated_summary_from_topics(self.prompt_sys, prompt, processed_files)
    
        def generate_topic_detail(self, text, topic, custom_prompt=None):
            prompt = custom_prompt if custom_prompt else self.prompt_detail
            return super().generate_topic_detail(self.prompt_sys, prompt, text, topic)
    

    Summary of what this does:

    • Maintains your strict formatting rules identical to your given example.
    • prompt_sys clearly defines the agent's role focused on supply chain and geopolitical/macro risks.
    • prompt_analyze specifically asks to find company statements on supply chain impacts due to geopolitical or macro circumstances and to reply "N/A" if none.
    • prompt_summary is set to gather and synthesize mentions across documents.
    • prompt_detail focuses on preparing a deeper briefing, always including verbatim excerpts under Ground Truth.
    • Methods override the base methods consistently as in the example.

    Let me know if you want me to help integrate this, tweak the prompts, or generate test scaffolding!

  5. User

    this is an sample example from agents.base_agent import BaseAgent

    class ConsumerHealthAgent(BaseAgent): prompt_sys = "Consumer health and macroeconomic analyst for Macy's, tasked with analyzing provided documents regarding consumer financial health and macro environment."

    # Universal formatting enforcement line (adapted and extended where necessary)
    formatting_directive = """Please strictly follow these formatting guidelines for all numerical mentions and sentence structures:
    
    1. No Combined Elements: Always space-separate numbers, words, and units (e.g., "3.3 billion" not "3.3billion").
    2. Time Formatting: Use formats like "Q4 2024" (never "Q42024" or "4th quarter").
    3. Number Rules:
      • 3.3B → 3.3 billion
      • 150.2M → 150.2 million
      • 0.33 → keep exact decimal
    4. Text Integrity:
      • "net income" never "netincome"
      • "year-over-year" never "YOY" or "yearoveryear"
      • "YOY " never "year-over-year" or "yearoveryear"
      • "vs." never "versus" or "vs"
      • "XB"never"XB" never "X billion"
      • "XM"never"XM" never "X million"
    5. Style Prohibition: Do not italicize or alter text formatting; maintain a single plain format throughout.
    6. Bad Example: 3.3billioninQ42024,withanadjustednetincomeof,106million,withadjustedearningsperdilutedshareat0.95 → REJECTED
    7. ALWAYS Required Format: 3.3 billion in Q4 2024, with an adjusted net income of → ACCEPTED

    APPLY THESE RULES TO ALL NUMERICAL MENTIONS AND SENTENCE STRUCTURES."""

    prompt_analyze = (
        "You are a senior business analyst working directly for Macy's CEO. Analyze the provided earnings call transcript and summarize mentions "
        "of consumer financial health and the macroeconomic environment.\n\n"
        "Identify key topics including but not limited to:\n"
        "- US consumer\n"
        "- The company’s customer\n"
        "- Change in demand\n"
        "- Change in spend\n\n"
        "For each topic, provide:\n"
        "- A clear topic name (e.g., \"E-commerce Growth\", \"Supply Chain Digitization\")\n"
        "- Concise 100-word summary providing key numbers and operational impacts\n"
        "- Strictly preserve original numerical and textual formatting: maintain exact decimals (0.33), required spacing (0.11 → '0.11'), and verbatim terminology without concatenation or rephrasing.\n"
        "- For every topic, ALWAYS provide excerpts mentioned under the heading \"Ground Truth\" as follows:\n"
        "      - For each document where the topic appears, extract the exact, unmodified sentence(s) or paragraph(s) from the original document.\n"
        "      - Format each excerpt as: **Ground Truth:** \"Exact text from the document...\" (Document Name)\n"
        "      - If a topic is present in multiple documents, include a separate \"Ground Truth\" excerpt for each document.\n"
        "      - Do NOT paraphrase, summarize, or alter the original text in any way. The excerpt must match the document data exactly, including all formatting, punctuation, and special characters.\n"
        "      - If the LLM cannot find an exact match in the document, do NOT fabricate or modify the excerpt—only include what is present in the documents.\n\n"
        "Format each topic as:\n"
        "- Topic Name: Summary [Relevance Score]\n\n"
        "Example:\n"
        "- Holiday Sales Performance: Q4 comparable sales up 4.2% driven by 18% digital growth [8]\n"
        "- Inventory Optimization: Implementing AI demand forecasting to reduce carrying costs by $150M [7]\n\n"
        "Document Text: " + formatting_directive
    )
    
    prompt_summary = (
        "You are a senior analyst preparing a summary of transcript commentary from all documents provided.\n"
        "Identify and describe all mentions of consumer financial health and the macroeconomic environment in the provided documents, "
        "focusing on what the company says about the US consumer, their customer, a change in demand, or a change in spend. Combine and synthesize topics that appear in multiple documents.\n\n"
        "1. **Overview**: Identify and describe all mentions of consumer financial health and the macroeconomic environment in the provided documents.\n\n"
        "2. For each topic:\n"
        "    * Provide a concise summary by combining information from all relevant documents.\n"
        "    * Include relevant examples, numerical data, or timelines from the documents.\n"
        "    * For every topic, ALWAYS provide each excerpt mentioned under the heading \"Ground Truth\" as follows:\n"
        "        - For each document where the topic appears, extract the exact, unmodified sentence(s) or paragraph(s) from the original document.\n"
        "        - Format each excerpt as: **Ground Truth:** \"Exact text from the document...\" (Document Name)\n"
        "        - If the same topic is present in multiple documents, always include a separate \"Ground Truth\" excerpt for each document with proper line breaks.\n"
        "        - Do NOT paraphrase, summarize, or alter the original text in any way. The excerpt must match the documents data exactly, including all formatting, punctuation, and special characters.\n"
        "        - If the LLM cannot find an exact match in the document, do NOT fabricate or modify the excerpt—only include what is present in the document.\n\n"
        "3. Format with clear sections in plain black text with proper headings:\n"
        "    * Consumer Health Summary\n\n"
        "Use the following Documents Analysis Data to combine similar topics from different documents and provide a comprehensive summary:\n"
        "{topics_block}\n\n"
        "Provide a comprehensive yet concise summary. STRICTLY ENFORCE PLAIN TEXT FORMATTING:\n"
        + formatting_directive
    )
    
    prompt_detail = (
        "You are preparing a detailed briefing for Macy's CEO on the consumer health topic '{topic}', based on the external company document.\n\n"
        "Provide:\n"
        "1. Overview of the topic.\n"
        "2. Key insights and relevant excerpts.\n"
        "3. Important figures, timelines, or operational metrics.\n"
        "4. Detailed analysis of the impact on Macy's consumer health outlook and macroeconomic environment.\n"
        "5. For every topic, ALWAYS provide verbatim source excerpts under the heading \"Ground Truth\" as follows:\n"
        "      - For each document where the topic appears, extract the exact, unmodified sentence(s) or paragraph(s) from the original document.\n"
        "      - Format each excerpt as: **Ground Truth:** \"Exact text from the document...\" (Document Name)\n"
        "      - If a topic is present in multiple documents, include a separate \"Ground Truth\" excerpt for each document.\n"
        "      - Do NOT paraphrase, summarize, or alter the original text in any way. The excerpt must match the source exactly, including all formatting, punctuation, and special characters.\n"
        "      - If the LLM cannot find an exact match in the document, do NOT fabricate or modify the excerpt—only include what is present in the source.\n\n"
        "Document:\n"
        "{text}\n\n"
        "Topic: {topic}\n\n"
        "Please provide a structured briefing with proper paragraphs and bold topics.\n"
        + formatting_directive
    )
    
    def analyze_document(self, text, custom_prompt=None):
        prompt_analyze = custom_prompt if custom_prompt else self.prompt_analyze
        return super().analyze_document(self.prompt_sys, prompt_analyze, text)
    
    def generate_consolidated_summary_from_topics(self, processed_files, custom_prompt=None):
        prompt_summary = custom_prompt if custom_prompt else self.prompt_summary
        return super().generate_consolidated_summary_from_topics(self.prompt_sys, prompt_summary, processed_files)
    
    def generate_topic_detail(self, text, topic, custom_prompt=None):
        prompt_detail = custom_prompt if custom_prompt else self.prompt_detail
        return super().generate_topic_detail(self.prompt_sys, prompt_detail, text, topic)
    

    as per this same file we need to create for the WholesaleAgent and the prompts inside it is like below

    Wholesale Prompt: Summarize what the company said regarding its performance within the wholesale channel. Highlight if the company mentioned department stores broadly or by name (Macy’s, Kohl’s, Nordstrom, Dillard’s, Saks, Neiman Marcus). If no detail is provided, say “N/A”.

  6. Assistant

    Certainly! Below is a full Python class WholesaleAgent following the exact structural, formatting, and method style of your ConsumerHealthAgent example, but customized for your requested Wholesale-related prompts:

    from agents.base_agent import BaseAgent
    
    class WholesaleAgent(BaseAgent):
        prompt_sys = (
            "Wholesale channel performance analyst for Macy's, tasked with analyzing provided documents "
            "regarding the company's performance in the wholesale channel, including any mentions of department stores generally or by name "
            "(Macy’s, Kohl’s, Nordstrom, Dillard’s, Saks, Neiman Marcus)."
        )
    
        # Reuse the same universal formatting directive as in ConsumerHealthAgent
        formatting_directive = """Please strictly follow these formatting guidelines for all numerical mentions and sentence structures:
    1. **No Combined Elements**: Always space-separate numbers, words, and units (e.g., "3.3 billion" not "3.3billion").
    2. **Time Formatting**: Use formats like "Q4 2024" (never "Q42024" or "4th quarter").
    3. **Number Rules**:  
       - 3.3B → 3.3 billion  
       - 150.2M → 150.2 million  
       - 0.33 → keep exact decimal  
    4. **Text Integrity**:  
       - "net income" never "netincome"  
       - "year-over-year" never "YOY" or "yearoveryear"  
       - "YOY " never "year-over-year" or "yearoveryear"  
       - "vs." never "versus" or "vs"  
       - "$XB" never "$X billion"  
       - "$XM" never "$X million"  
    5. **Style Prohibition**: Do not italicize or alter text formatting; maintain a single plain format throughout.
    6. **Bad Example**: `3.3billioninQ42024,withanadjustednetincomeof,106million,withadjustedearningsperdilutedshareat0.95` → REJECTED
    7. **ALWAYS Required Format**: `3.3 billion in Q4 2024, with an adjusted net income of` → ACCEPTED
    
    APPLY THESE RULES TO ALL NUMERICAL MENTIONS AND SENTENCE STRUCTURES."""
    
        prompt_analyze = (
            "You are a senior business analyst working directly for Macy's CEO. Analyze the provided earnings call transcript and summarize everything "
            "the company said regarding its performance within the wholesale channel.\n\n"
            "Be sure to highlight any mentions of department stores broadly or by name, including Macy’s, Kohl’s, Nordstrom, Dillard’s, Saks, or Neiman Marcus.\n"
            "If no details are provided regarding the wholesale channel or department stores, respond with \"N/A\".\n\n"
            "Strictly preserve all original numerical and textual formatting, including exact decimals and spacing.\n"
            "For each mention, ALWAYS include verbatim excerpts under the heading \"Ground Truth\" as follows:\n"
            "  - Extract exact, unmodified sentence(s) or paragraphs from the original document.\n"
            "  - Format each excerpt as: **Ground Truth:** \"Exact text from the document...\" (Document Name)\n"
            "  - If multiple documents contain relevant mentions, include separate excerpts for each.\n"
            "  - Do NOT paraphrase, summarize, or alter the original text in any way.\n"
            "  - Do NOT fabricate or add text not present in the documents.\n\n"
            "Document Text: " + formatting_directive
        )
    
        prompt_summary = (
            "You are a senior analyst preparing a combined summary of all transcript commentary related to Macy's wholesale channel performance from all provided documents.\n\n"
            "Identify and describe all mentions of wholesale channel performance and any references to department stores, whether broadly or specifically named (Macy’s, Kohl’s, Nordstrom, Dillard’s, Saks, Neiman Marcus).\n"
            "If no such mentions exist, state clearly \"N/A\".\n\n"
            "For every mention, ALWAYS provide verbatim excerpts under the heading \"Ground Truth\" formatted as:\n"
            "  **Ground Truth:** \"Exact text from the document...\" (Document Name)\n"
            "Include separate excerpts for multiple documents if applicable.\n"
            "Do NOT paraphrase or fabricate excerpts.\n\n"
            "Ensure clear sections with plain black text formatting.\n"
            + formatting_directive
        )
        
        prompt_detail = (
            "You are preparing a detailed briefing for Macy's CEO on the wholesale channel topic '{topic}', based on the external company document.\n\n"
            "Provide:\n"
            "1. Overview of the company's wholesale channel performance commentary.\n"
            "2. Details on any department stores mentioned, broadly or by name (Macy’s, Kohl’s, Nordstrom, Dillard’s, Saks, Neiman Marcus).\n"
            "3. Key figures, operational metrics, or timelines if provided.\n"
            "4. Analysis of how these comments affect Macy's wholesale business outlook.\n"
            "5. For every point, ALWAYS provide verbatim source excerpts under the heading \"Ground Truth\" as follows:\n"
            "   - Extract exact, unmodified sentence(s) or paragraphs from the original document(s).\n"
            "   - Format each excerpt as: **Ground Truth:** \"Exact text from the document...\" (Document Name)\n"
            "   - Include separate excerpts if the topic appears in multiple documents.\n"
            "   - Do NOT paraphrase, summarize, or fabricate text.\n\n"
            "Document:\n"
            "{text}\n\n"
            "Topic: {topic}\n\n"
            "Please provide a well-structured briefing with clear paragraphs and bold headings.\n"
            + formatting_directive
        )
    
        def analyze_document(self, text, custom_prompt=None):
            prompt = custom_prompt if custom_prompt else self.prompt_analyze
            return super().analyze_document(self.prompt_sys, prompt, text)
    
        def generate_consolidated_summary_from_topics(self, processed_files, custom_prompt=None):
            prompt = custom_prompt if custom_prompt else self.prompt_summary
            return super().generate_consolidated_summary_from_topics(self.prompt_sys, prompt, processed_files)
    
        def generate_topic_detail(self, text, topic, custom_prompt=None):
            prompt = custom_prompt if custom_prompt else self.prompt_detail
            return super().generate_topic_detail(self.prompt_sys, prompt, text, topic)
    

    Notes:

    • This matches your example on prompt style, formatting directives, and docstring/comment styles.
    • The agent focuses on "Wholesale" and specifically mentions department stores by name or broad reference.
    • If no mention is found, the standard fallback "N/A" is specified in the prompt.
    • All prompts emphasize strict preservation of text and number formatting.
    • Methods override the BaseAgent accordingly, consistent with your provided sample.

    If you'd like, I can also help generate unit tests or usage examples for this agent class. Just ask!