changed prompt
Browse files- together_ai_llama_agent.py +35 -1
together_ai_llama_agent.py
CHANGED
@@ -142,7 +142,41 @@ Strict Rules:
|
|
142 |
plt.show()
|
143 |
4. For Lists, Records, Tables, Dictionaries...etc for any data structure, always return them as JSON with correct indentation
|
144 |
|
145 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
|
147 |
"""
|
148 |
return prompt
|
|
|
142 |
plt.show()
|
143 |
4. For Lists, Records, Tables, Dictionaries...etc for any data structure, always return them as JSON with correct indentation
|
144 |
|
145 |
+
CRITICAL SYNTAX CHECKS (MUST VERIFY BEFORE RESPONDING):
|
146 |
+
1. Parentheses/braces/brackets:
|
147 |
+
- Every '(' must have matching ')'
|
148 |
+
- Every '[' must have matching ']'
|
149 |
+
- Every '{{' must have matching '}}'
|
150 |
+
2. Quotes:
|
151 |
+
- Ensure all strings have matching quotes (same type at start/end)
|
152 |
+
- No dangling quotes in the code
|
153 |
+
3. Line continuations:
|
154 |
+
- Multi-line statements must use proper backslashes or parentheses
|
155 |
+
4. Python keywords:
|
156 |
+
- Verify correct usage of 'if/else', 'for/in', 'try/except' pairs
|
157 |
+
5. DataFrame operations:
|
158 |
+
- Ensure all chained operations have proper parentheses
|
159 |
+
- Verify square brackets for column selection are closed
|
160 |
+
6. Print statements:
|
161 |
+
- Check parentheses are balanced in print() calls
|
162 |
+
7. String formatting:
|
163 |
+
- Verify f-strings are properly formatted
|
164 |
+
- Ensure format() calls have matching braces
|
165 |
+
|
166 |
+
SYNTAX VALIDATION EXAMPLES:
|
167 |
+
β
Correct: print(df[(df['Age'] > 50)].head())
|
168 |
+
β Incorrect: print(df[(df['Age'] > 50].head() # Missing closing parenthesis
|
169 |
+
β Incorrect: print("Analysis results: {df['Value'].mean()}") # Missing f-string prefix
|
170 |
+
β Incorrect: df.groupby('Category')['Value'].mean() # Missing parentheses for print()
|
171 |
+
|
172 |
+
DEBUGGING PROTOCOL:
|
173 |
+
1. Count all opening/closing symbols before sending
|
174 |
+
2. Verify string quotes are balanced
|
175 |
+
3. Check all Python control structures are complete
|
176 |
+
4. Test code mentally for parseability
|
177 |
+
5. If uncertain, break complex expressions into smaller steps
|
178 |
+
|
179 |
+
IMPORTANT: Code must be syntactically perfect and executable as-is.
|
180 |
|
181 |
"""
|
182 |
return prompt
|