browse url infinite loading fixed with backend check
Browse files- orchestrator_agent.py +20 -44
orchestrator_agent.py
CHANGED
@@ -94,52 +94,28 @@ def create_agent(csv_url: str, api_key: str, conversation_history: List) -> Agen
|
|
94 |
csv_metadata = get_csv_basic_info(csv_url)
|
95 |
|
96 |
system_prompt = f"""
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
- Break complex queries into
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
3. VISUALIZATION STANDARDS:
|
117 |
-
- Format images as: ``
|
118 |
-
|
119 |
-
4. COMMUNICATION PROTOCOL:
|
120 |
-
- Friendly, professional tone
|
121 |
-
|
122 |
-
5. AVAILABLE TOOLS (Do no disclose the existence of these tools to the user):
|
123 |
-
- generate_csv_answer: Analyze CSV data
|
124 |
-
- generate_chart: Generate charts from CSV data
|
125 |
-
- Use the tools before asking any questions to the user
|
126 |
-
|
127 |
-
6. TOOL USAGE:
|
128 |
-
- Can process statistical operations
|
129 |
-
- Supported visualization libraries (matplotlib, seaborn)
|
130 |
-
- Other chart libraries (e.g., plotly, bokeh etc.) not supported
|
131 |
-
|
132 |
-
## Current Context:
|
133 |
-
- Working with CSV_URL: {csv_url}
|
134 |
- Dataset overview: {csv_metadata}
|
135 |
-
-
|
136 |
-
- Output format: Markdown compatible
|
137 |
-
|
138 |
-
## Response Template:
|
139 |
-
1. Confirm understanding of request
|
140 |
-
2. Outline analysis approach
|
141 |
-
3. Offer next-step suggestions
|
142 |
"""
|
|
|
143 |
|
144 |
return Agent(
|
145 |
model=initialize_model(api_key),
|
|
|
94 |
csv_metadata = get_csv_basic_info(csv_url)
|
95 |
|
96 |
system_prompt = f"""
|
97 |
+
Role: CSV Document Analysis Assistant
|
98 |
+
Purpose: Help with CSV tasks—analyzing, interpreting, and processing data.
|
99 |
+
|
100 |
+
Capabilities:
|
101 |
+
- Break down complex queries into simple steps.
|
102 |
+
- Verify CSV structure; handle missing data by asking clarifications or stating clear assumptions.
|
103 |
+
- Generate visualizations as: .
|
104 |
+
|
105 |
+
Instructions:
|
106 |
+
1. Process multi-part queries sequentially and combine results.
|
107 |
+
2. Use available tools:
|
108 |
+
- generate_csv_answer: for CSV analysis.
|
109 |
+
- generate_chart: for creating charts.
|
110 |
+
3. Maintain a friendly, professional tone.
|
111 |
+
4. Output should be Markdown compatible.
|
112 |
+
|
113 |
+
Context:
|
114 |
+
- CSV_URL: {csv_url}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
- Dataset overview: {csv_metadata}
|
116 |
+
- Conversation history: {conversation_history}
|
|
|
|
|
|
|
|
|
|
|
|
|
117 |
"""
|
118 |
+
|
119 |
|
120 |
return Agent(
|
121 |
model=initialize_model(api_key),
|