You are an senior assistant responding ONLY to greetings from Macy's executive staff. Reply with a polite greeting message only. No additional information but respond properly for every question do not use any other source.
Greeting input:
{question}
Your reply:
"""
if self.is_azure:
messages = [
{"role": "system", "content": "Assistant specialized in greeting responses."},
{"role": "user", "content": greeting_prompt}
]
response = self.client.generate(messages=messages, temperature=0)
return response.choices[0].message.content.strip(), q_type
else:
return self.client.generate("Assistant specialized in greeting responses.", greeting_prompt), q_type
You are a senior analyst answering questions for Macy's executive team. Follow these steps:
{analysis_approach}
Cross-reference all relevant documents
Identify numerical data and timelines
Assess impacts on retail operations
Formulate executive-level recommendations
If user asks about a single document and multiple selected, answer from only that one.
If user asks about multiple documents, synthesize across all.
Greetings get polite greeting responses only.
Current question type: {q_type.upper()}
Question: {question}
Relevant documents:
{files_context}
Provide a structured response with:
Clear headings
Bullet points for key findings
Bolded key figures and dates
Separate recommendations section
If information conflicts between documents, note explicitly.
"""
if self.is_azure:
messages = [
{"role": "system", "content": "Senior analyst synthesizing information from multiple documents"},
{"role": "user", "content": base_prompt},
]
response = self.client.generate(messages=messages, temperature=0)
return response.choices[0].message.content.strip(), q_type
else:
return self.client.generate("Senior analyst synthesizing information from multiple documents", base_prompt), q_type
this was enhanced_chat_agent.py
from agents.base_agent import BaseAgent
class SalesAgent(BaseAgent):
prompt_sys = "Sales analyst for Macy's executive team"
prompt_analyze = """You are a senior sales analyst specializing in retail sales and consumer behavior, assisting Macy's executive team.
You have received a transcript/document from another company.
Identify all significant sales and consumer behavior topics that could affect Macy's retail sales strategy, revenue, marketing effectiveness, and customer engagement.
For each topic, provide:
A concise topic name (e.g., "Holiday Sales Surge", "Online Shopping Trends").
A brief describing in 200 words including its relevance or impact on Macy's sales, considering the external company's context, also include An overview of the topic, Key insights and relevant excerpts, Important figures, dates, or timelines, Detailed analysis of the impact on Macy's retail sales, marketing, and customer engagement.
A relevance score from 1 (minor) to 10 (critical).
Format your response one topic per line:
Topic Name: Summary [Relevance Score]
Example:
Holiday Sales Boost: Significant increase in sales volume expected during holidays [9]
Analyze the following external company document:"""
code
prompt_summary = """You are a senior sales analyst preparing a consolidated sales and consumer behavior report for Macy's executive team.
You have reviewed sales and consumer behavior topics extracted from multiple external company documents. These topics include their names, summaries, and relevance scores. Based on their content, please:
OverView: Identify and describe from all documents all their impactful sales and consumer behavior topics that could affect Macy's retail sales, marketing, and customer engagement.
For each topic:
Provide a concise summary from combining all the documents.
Include relevant numerical data or timelines from the documents also provide from which document it is taken.
Explain operational and strategic impacts—positive, negative, or neutral—specifically tailored to Macy's retail business.
Provide 3-5 actionable strategic recommendations for Macy's leadership.
Use markdown formatting with clear headings.
Avoid jargon and focus on actionable insights tailored for Macy's.
Format response in markdown with clear headings.
Extracted topics from documents:
{topics_block}
Deliver a detailed, actionable consolidated sales report for Macy's."""
code
prompt_detail = """You are preparing a detailed briefing for Macy's CEO on the sales topic '{topic}', based on the external company document.
Provide:
An overview of the topic.
Key insights and relevant excerpts.
Important figures, dates, or timelines.
Detailed analysis of the impact on Macy's retail sales, marketing, and customer engagement.
3-5 actionable recommendations for Macy's leadership.
class SupplyChainAgent(BaseAgent):
prompt_sys = "Supply chain analyst for Macy's"
prompt_analyze = """You are a senior supply chain analyst specializing in logistics and procurement for Macy's operations.
You have received a transcript/document from another company.
Identify all significant supply chain and logistics topics in the text that could affect Macy's procurement, inventory, delivery timelines, and supplier relationships.
For each topic, provide:
A concise topic name (e.g., "Port Congestion", "Supplier Delays").
A brief describing in 200 words including its impact on Macy's supply chain operations also include Overview of the topic, Key insights and relevant excerpts, Important figures, timelines, or operational metrics, Detailed analysis on impact to Macy's supply chain, procurement, and logistics.
A relevance score from 1 (minor) to 10 (critical).
Format your response one topic per line:
Topic Name: Summary [Relevance Score]
Example lines:
Port Congestion: Delays expected affecting inventory availability [9]
Supplier Delay: Lead times extended due to supplier issues [8]
Analyze this external document:"""
code
prompt_summary = """You are a senior supply chain analyst preparing a consolidated supply chain and procurement report for Macy's executive team.
You have reviewed supply chain and logistics topics extracted from multiple external company documents. These topics include their names, summaries, and relevance scores. Based on their content, please:
OverView: Identify and describe all their impactful supply chain and logistics topics that could affect Macy's inventory management, procurement, delivery timelines, and supplier relationships.
For each topic:
Provide a concise summary from combining all the documents.
Include relevant metrics, timelines, or examples from the documents also provide from which document it is taken.
Explain operational and strategic impacts—positive, negative, or neutral—specifically tailored to Macy's supply chain and logistics.
Provide 3-5 actionable strategic recommendations for Macy's leadership.
Use markdown formatting with clear headings.
Avoid jargon and focus on practical operational impacts and strategy insights.
Format response in markdown with clear headings.
Extracted topics from documents:
{topics_block}
Deliver a detailed, actionable consolidated supply chain report for Macy's."""
code
prompt_detail = """You are preparing a detailed briefing for Macy's CEO on the supply chain topic '{topic}', based on the external company document.
Provide:
Overview of the topic.
Key insights and relevant excerpts.
Important figures, timelines, or operational metrics.
Detailed analysis on impact to Macy's supply chain, procurement, and logistics.
3-5 actionable recommendations for Macy's leadership.
class TariffTradeAgent(BaseAgent):
prompt_sys = "Tariff and trade policy analyst for Macy's CEO"
prompt_analyze = """You are a senior tariff and international trade policy analyst assisting a research team working for the CEO of Macy's.
You have received a transcript/document from another company.
Carefully identify all significant tariff, trade, and related government policy topics and detailed briefing in the text that could affect Macy's business operations, including supply chain, procurement, retail sales, and technology.
For each topic, provide:
A clear and concise topic name (e.g., "Vietnam Production Impact", "US-China Tariffs").
A brief describing in 200 words including its operational or strategic impact on Macy's retail business, considering the external company's context also include A clear overview of the topic, Key insights and any relevant direct excerpts from the document, Important figures, dates, or timelines if available, Detailed analysis on how this topic could impact Macy's retail operations, supply chain, procurement, and consumer behavior.
A relevance score from 1 (minor) to 10 (critical).
Format your response as one topic per line in the format:
Topic Name: Summary [Relevance Score]
Example:
Vietnam Factory Shutdown: Supply chain delays expected due to production halt in Vietnam [9]
Tariff Changes on Apparel: Increased costs on imports from China may raise prices [8]
Analyze the following external company document for all relevant tariff and trade topics. Text:"""
code
prompt_summary = """You are a senior tariff and trade analyst preparing a consolidated tariff and trade policy report for Macy's executive team.
You have reviewed tariff and trade topics extracted from multiple external company documents. These topics include their names, summaries, and relevance scores. Based on their content, please:
OverView: Identify and describe from all documents all their impactful tariff, trade, and related government policy topics that could affect Macy's business operations, including supply chain, procurement, retail sales, and technology.
For each topic:
Provide a concise summary from combining all the documents.
Include relevant examples, numerical data, or timelines from the documents also provide from which document it is taken.
Explain operational and strategic impacts—positive, negative, or neutral—specifically tailored to Macy's retail business.
Provide 3-5 actionable strategic recommendations for Macy's leadership.
Use markdown formatting with clear headings.
Avoid jargon and focus on practical operational impacts and strategy insights.
Format your response in markdown with clear headings for each topic.
Here are the topics extracted from documents:
{topics_block}
Deliver a detailed, synthesized, and actionable consolidated tariff and trade policy report for Macy's."""
code
prompt_detail = """You are preparing a detailed briefing for Macy's CEO on the tariff and trade policy topic '{topic}', based on the provided external company document.
Provide:
A clear overview of the topic.
Key insights and any relevant direct excerpts from the document.
Important figures, dates, or timelines if available.
Detailed analysis on how this topic could impact Macy's retail operations, supply chain, procurement, and consumer behavior.
3-5 actionable strategic recommendations for Macy's leadership.
Document:
{text}
Topic: {topic}
Please deliver the response as structured markdown suitable for executive briefing."""
import streamlit as st
from io import BytesIO
from datetime import datetime
from utils.pdf_utils import extract_text
from clients.azure_client import AzureClient
from clients.gemini_client import GeminiClient
from agents.tariff_agent import TariffTradeAgent
from agents.sales_agent import SalesAgent
from agents.supply_chain_agent import SupplyChainAgent
from agents.enhanced_chat_agent import EnhancedChatAgent
you're passing 4 arguments to generate_topic_detail(), but in the TariffTradeAgent class (which inherits from BaseAgent), your generate_topic_detail method is only defined as:
So your method is receiving more parameters than expected, causing the error.
How to fix
You DO NOT need to pass prompt_sys and prompt_detail again if your agent's generate_topic_detail method already wraps the base class call with those prompts.