This repository was archived by the owner on Nov 10, 2025. It is now read-only.
Commit 39a5b4a
fix: correct CodeInterpreterSchema libraries_used field example
- Fix misleading Field description example that showed comma-separated string
- Change example from 'numpy,pandas,beautifulsoup4' to ['numpy', 'pandas', 'beautifulsoup4']
- Add comprehensive schema validation tests to prevent regression
- Resolves issue #3512 where LLM agents generated invalid input format
The libraries_used field expects List[str] but the example in the Field description
was showing a comma-separated string format, causing LLM agents to generate
input that failed Pydantic validation with 'Field required' errors.
Tests added:
- test_code_interpreter_schema_validation_valid_list: Verifies List[str] works
- test_code_interpreter_schema_validation_invalid_string: Verifies strings are rejected
- test_code_interpreter_schema_validation_empty_list: Verifies empty list works
- test_code_interpreter_schema_field_description: Verifies example format is correct
Co-Authored-By: João <joao@crewai.com>1 parent 78317b9 commit 39a5b4a
File tree
2 files changed
+49
-1
lines changed- crewai_tools/tools/code_interpreter_tool
- tests/tools
2 files changed
+49
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
0 commit comments