KarthikMuraliM commited on
Commit
2447a6d
·
verified ·
1 Parent(s): 5cf75cf

updated prompt to handle images

Browse files
Files changed (1) hide show
  1. main.py +7 -4
main.py CHANGED
@@ -143,12 +143,15 @@ async def process_analysis_request(request: Request):
143
  CRITICAL RULES:
144
  1. **CHOOSE A STRATEGY:** First, analyze the request. Is it a simple task for a specialized tool, or a complex one requiring a full script?
145
  2. **TOOL NAMES:** You MUST use the exact tool names from the provided list.
146
- 3. **DATA CLEANING (IMPORTANT):** When you load a CSV file using pandas, the column names might have leading/trailing whitespace. Your first step after loading the data MUST be to clean the column names. A good method is: `df.columns = df.columns.str.strip()`.
147
- 4. **FINAL OUTPUT (CRITICAL):** You MUST read the user's request very carefully to determine the exact final output format.
 
 
 
148
  - If the user asks for a **JSON object with specific keys**, your script's final print statement MUST produce a JSON object with EXACTLY those keys and data types.
149
  - If the user asks for a **JSON array**, your script's final print statement MUST produce a JSON array with the raw values in the correct order.
150
- 5. **NO PLACEHOLDERS:** You MUST perform the actual calculations and data analysis required. Do not use placeholder or example values in your final output. The results must be derived from the provided data sources.
151
- 6. Your entire output MUST be ONLY a valid JSON object representing the execution plan. The plan should follow this schema: {{"plan": {{"steps": [{{...}}]}}}}
152
  """
153
 
154
 
 
143
  CRITICAL RULES:
144
  1. **CHOOSE A STRATEGY:** First, analyze the request. Is it a simple task for a specialized tool, or a complex one requiring a full script?
145
  2. **TOOL NAMES:** You MUST use the exact tool names from the provided list.
146
+ 3. **SPECIAL TOOL USAGE - `analyze_image_content`:** If you choose to use the `analyze_image_content` tool, you MUST provide both the `image_path` and a `prompt`. The `prompt` argument **MUST** contain all the specific questions the user has asked about the image, extracted from their main request.
147
+ 4. **DATA CLEANING (IMPORTANT):
148
+ a. ** When you load a CSV file using pandas, the column names might have leading/trailing whitespace. Your first step after loading the data MUST be to clean the column names. A good method is: `df.columns = df.columns.str.strip()`.**
149
+ b. **When identifying columns, you MUST perform a case-insensitive match. A robust method is to convert all column names to lowercase for comparison, like this: `df_cols_lower = [c.lower() for c in df.columns]` and then search for your lowercase keywords (e.g., 'sales') in that list.**
150
+ 5. **FINAL OUTPUT (CRITICAL):** You MUST read the user's request very carefully to determine the exact final output format.
151
  - If the user asks for a **JSON object with specific keys**, your script's final print statement MUST produce a JSON object with EXACTLY those keys and data types.
152
  - If the user asks for a **JSON array**, your script's final print statement MUST produce a JSON array with the raw values in the correct order.
153
+ 6. **NO PLACEHOLDERS:** You MUST perform the actual calculations and data analysis required. Do not use placeholder or example values in your final output. The results must be derived from the provided data sources.
154
+ 7. Your entire output MUST be ONLY a valid JSON object representing the execution plan. The plan should follow this schema: {{"plan": {{"steps": [{{...}}]}}}}
155
  """
156
 
157