Commit 682dcf2
Francisco
feat(rust): port fc_parser to Rust extension via PyO3
- Add rust/fc_parser/ — new Rust extension alongside delta_normalizer
and request_router
- Implements parse_function_calls(accumulated_content, assistant_reply)
returning List[Dict] — drop-in replacement for the Python hot path
- Regex compilation via once_cell::Lazy — compiled once at module load
- Handles: <fc> tag scanning, <plan> stripping, JSON repair, smart quote
normalisation, trailing comma removal, string-encoded argument
unwrapping, batch extraction, loose fallback, ID generation
- All 7 tests passing: tests/rust/test_fc_parser.py
- Update tool_routing_mixin.py — remove Python parsing implementation,
delegate to fc_parser Rust extension in parse_and_set_function_calls()
- Remove dead imports: json, re, uuid, FC_REGEX, _normalize_arguments1 parent 96d408d commit 682dcf2
8 files changed
Lines changed: 1058 additions & 82 deletions
File tree
- rust/fc_parser
- src
- src/api/entities_api/orchestration/mixins
- tests
- integration
- rust
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
0 commit comments