Soumik555 commited on
Commit
d64b05a
·
1 Parent(s): 49251aa

Report generator

Browse files
documents/enterprise_sales_data.csv ADDED
The diff for this file is too large to render. See raw diff
 
orchestrator_agent.py CHANGED
@@ -57,36 +57,15 @@ def create_agent(csv_url: str, api_key: str) -> Agent:
57
  csv_metadata = get_csv_basic_info(csv_url)
58
 
59
  system_prompt = (
60
- "You are a data analyst assistant with limited tool capabilities. "
61
- "Available tools can only handle simple data queries: "
62
- "- Count rows/columns\n- Calculate basic stats (avg, sum, min/max)\n"
63
- "- Create simple visualizations (pie charts, bar graphs)\n"
64
- "- Show column names/types\n\n"
65
-
66
- "Query Handling Rules:\n"
67
- "1. If query is complex, ambiguous, or exceeds tool capabilities:\n"
68
- " - Break into simpler sub-questions\n"
69
- " - Ask for clarification\n"
70
- " - Rephrase to nearest simple query\n"
71
- "2. For 'full report' requests:\n"
72
- " - Outline possible analysis steps\n"
73
- " - Ask user to select one component at a time\n\n"
74
-
75
- "Examples:\n"
76
- "- Bad query: 'Show me everything'\n"
77
- " Response: 'I can show row count (10), columns (5: Name, Age...), "
78
- "or a pie chart of categories. Which would you like?'\n"
79
- "- Bad query: 'Analyze trends'\n"
80
- " Response: 'For trend analysis, I can show monthly averages or "
81
- "year-over-year comparisons. Please specify time period and metric.'\n\n"
82
-
83
- "Current CSV Context:\n"
84
- f"- URL: {csv_url}\n"
85
- f"- Metadata: {csv_metadata}\n\n"
86
-
87
- "Always format images as: ![Chart Description](direct-image-url)"
88
  )
89
-
90
  return Agent(
91
  model=initialize_model(api_key),
92
  deps_type=str,
@@ -94,7 +73,6 @@ def create_agent(csv_url: str, api_key: str) -> Agent:
94
  system_prompt=system_prompt
95
  )
96
 
97
-
98
  def csv_orchestrator_chat(csv_url: str, user_question: str) -> str:
99
  print("CSV URL:", csv_url)
100
  print("User questions:", user_question)
 
57
  csv_metadata = get_csv_basic_info(csv_url)
58
 
59
  system_prompt = (
60
+ "You are a data analyst."
61
+ "You have all the tools you need to answer any question."
62
+ "If user asking for multiple answers or charts then break the question into multiple proper questions."
63
+ "Pass csv_url/path with the questions to the tools to generate the answer."
64
+ "Explain the answer in a friendly way."
65
+ "**Format images** in Markdown: `![alt_text](direct-image-url)`"
66
+ f"Your csv url is {csv_url}"
67
+ f"Your csv metadata is {csv_metadata}"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  )
 
69
  return Agent(
70
  model=initialize_model(api_key),
71
  deps_type=str,
 
73
  system_prompt=system_prompt
74
  )
75
 
 
76
  def csv_orchestrator_chat(csv_url: str, user_question: str) -> str:
77
  print("CSV URL:", csv_url)
78
  print("User questions:", user_question)