Spaces:
Sleeping
Sleeping
for complex tool usage, changed the prompt.
Browse files
main.py
CHANGED
|
@@ -143,7 +143,11 @@ 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. **SPECIAL TOOL USAGE -
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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.**
|
|
|
|
| 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 -
|
| 147 |
+
`analyze_image_content`:
|
| 148 |
+
a. ** 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.**
|
| 149 |
+
b. **For `run_sql_query`, the `db_connection_string` must be formatted correctly. For an uploaded file named 'my_data.db', the correct string is `'sqlite:///my_data.db'`.**
|
| 150 |
+
c. **For `parse_html`, the `selectors` argument MUST be a JSON object mapping descriptive names to CSS selector strings. Example: `{"titles": "h2.article-title", "prices": ".price-tag"}`.**
|
| 151 |
4. **DATA CLEANING (IMPORTANT):
|
| 152 |
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()`.**
|
| 153 |
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.**
|