Commit 7a73959
fix: preserve negative sign when parsing float fields in TrainingConverter
_FLOAT_PATTERN had no `-?`, so _parse_float('-5.2') returned 5.2 and
"-3 degrees" parsed as 3.0 -- silently flipping the sign of any negative
value during TrainingConverter's field-by-field fallback extraction
(used when a smaller LLM's direct-to-Pydantic conversion fails).
Reachable for any Pydantic model field typed `float` via
_process_field_value -> _parse_float.
Add the missing `-?` to the pattern.
AI-Generated PR: Yes, drafted with Claude Code and personally
reviewed/tested before submission. Per CONTRIBUTING.md's llm-generated
label requirement: as an external contributor I cannot self-apply GitHub
labels (confirmed via `gh pr edit --add-label`, GraphQL permission
error) -- disclosing here in the PR body/commit instead; happy to have
a maintainer apply the label if needed.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 0e5d0ec commit 7a73959
2 files changed
Lines changed: 10 additions & 1 deletion
File tree
- lib/crewai
- src/crewai/utilities
- tests/utilities
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
0 commit comments