Commit 99f5d8f
Add chat content detector (input detection only) (foundation-model-stack#276)
* ✨ Add new datatype for internal conversion of chat content objects
* ♻️ Refactor some implementations and add request conversion
* ✨ Add detectors config in openai request
* 🧑💻 Add detection response and warning in openai chat completion response
* 🐛 Push detector processing module missed earlier
* ♻️ Make certain data models available public
* ♻️ Refactor chunking mechanism
* 🚧 Iterate over chunking for chat completion content detection
* 🐛 Fixed compiler error for iterating over chat messages
* 🚧 Add content detection function with datatype transformations
* 🚧 Add input detection handling to main function call
* 🐛 Fix validation error propagation for filtering messages
* 🐛 Fix error handling for chunker
* ⚰️ Remove print lines and deadcode
* 🐛 Remove orchestrator detection result tagged response
* 🐛 Fix detections and results typo
* 🔧 Make detector optional in request and add some error handling todos
* 🎨 Fix formatting and clippy warnings
* ♻️ Refactor part of detection logic for chat completion to allow proper message indexing
* :white_check_marks: Add unit test for message filtering
* 🚚 Rename filter_chat_messages function to preprocess
* 🔧 Fix dummy user id generation and add system to allowed message role
* 🔧 Fix according to review suggestions
* Apply suggestions from code review
Co-authored-by: Evaline Ju <[email protected]>
Co-authored-by: Dan Clark <[email protected]>
Signed-off-by: Gaurav Kumbhat <[email protected]>
* 🎨🚚 Rename and modify optional parameter as per review suggestions
* ⚡ Remove need to clone and perform inplace sorting
* ⚡✨ Address review suggestions and fixes
* Replace warning type from string to predefined type
* Add input detection error to warning
* Replace detection result sorting to previous method and remove results cloning
* Remove extra cloning for filter_chat_message function
* Detector message traversal optimizations
* Add empty message validation
* Apply suggestions from code review
Co-authored-by: Dan Clark <[email protected]>
Signed-off-by: Gaurav Kumbhat <[email protected]>
* 🎨 replace match statement with let-else to rustify
* Apply suggestions from code review
Co-authored-by: Dan Clark <[email protected]>
Signed-off-by: Gaurav Kumbhat <[email protected]>
* :white_check_marks: Fix unit test and rename filter message function
* ➕ Add uuid in cargo file
* ♻️ Refactor request object handling to avoid cloning
---------
Signed-off-by: gkumbhat <[email protected]>
Signed-off-by: Gaurav Kumbhat <[email protected]>
Co-authored-by: Evaline Ju <[email protected]>
Co-authored-by: Dan Clark <[email protected]>1 parent 1dd51fb commit 99f5d8f
File tree
10 files changed
+701
-25
lines changed- src
- clients
- orchestrator
- detector_processing
- streaming
10 files changed
+701
-25
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
31 | 35 | | |
32 | 36 | | |
33 | 37 | | |
| |||
157 | 161 | | |
158 | 162 | | |
159 | 163 | | |
160 | | - | |
| 164 | + | |
161 | 165 | | |
162 | 166 | | |
163 | 167 | | |
164 | 168 | | |
165 | 169 | | |
166 | | - | |
| 170 | + | |
167 | 171 | | |
168 | 172 | | |
169 | 173 | | |
| |||
275 | 279 | | |
276 | 280 | | |
277 | 281 | | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
278 | 299 | | |
279 | 300 | | |
280 | 301 | | |
| |||
386 | 407 | | |
387 | 408 | | |
388 | 409 | | |
389 | | - | |
| 410 | + | |
390 | 411 | | |
391 | 412 | | |
392 | 413 | | |
| |||
430 | 451 | | |
431 | 452 | | |
432 | 453 | | |
433 | | - | |
| 454 | + | |
434 | 455 | | |
435 | 456 | | |
436 | 457 | | |
| |||
439 | 460 | | |
440 | 461 | | |
441 | 462 | | |
442 | | - | |
| 463 | + | |
443 | 464 | | |
444 | 465 | | |
445 | 466 | | |
| |||
455 | 476 | | |
456 | 477 | | |
457 | 478 | | |
458 | | - | |
| 479 | + | |
459 | 480 | | |
460 | 481 | | |
461 | 482 | | |
| |||
485 | 506 | | |
486 | 507 | | |
487 | 508 | | |
488 | | - | |
| 509 | + | |
489 | 510 | | |
490 | 511 | | |
491 | 512 | | |
| |||
506 | 527 | | |
507 | 528 | | |
508 | 529 | | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
509 | 536 | | |
510 | 537 | | |
511 | 538 | | |
| |||
621 | 648 | | |
622 | 649 | | |
623 | 650 | | |
624 | | - | |
| 651 | + | |
625 | 652 | | |
626 | 653 | | |
627 | 654 | | |
| |||
665 | 692 | | |
666 | 693 | | |
667 | 694 | | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
908 | 908 | | |
909 | 909 | | |
910 | 910 | | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
911 | 918 | | |
912 | 919 | | |
913 | 920 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
0 commit comments