Commit c803fa9
authored
feat: enhance response handling with reasoning support (#178)
* feat: enhance response handling with reasoning support
* Updated ConversationId struct to derive Copy trait for improved usability.
* Introduced reasoning token tracking in ResponseStreamContext to accumulate reasoning tokens during response processing.
* Added new methods in ResponseServiceImpl for emitting reasoning events and processing reasoning tags in text deltas.
* Enhanced Usage model to include reasoning tokens in usage calculations.
* Implemented tests for reasoning tag processing and token estimation to ensure functionality and correctness.
* refactor: few fixes and clippy
* Removed unnecessary cloning of conversation_id in service methods for improved performance and clarity.
* Updated related function calls to directly use conversation_id, enhancing code readability and efficiency.
* refactor: streamline code formatting and improve readability
* Removed unnecessary line breaks and simplified function calls in `service.rs` and `service_helpers.rs` for better clarity.
* Enhanced the formatting of method parameters and function calls across multiple files to maintain consistency and improve code readability.
* Updated tests to reflect changes in function call formatting, ensuring all tests remain functional and clear.1 parent 7c8b897 commit c803fa9
5 files changed
Lines changed: 535 additions & 34 deletions
File tree
- crates/services/src
- conversations
- responses
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
300 | | - | |
| 300 | + | |
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
| 370 | + | |
376 | 371 | | |
377 | 372 | | |
378 | 373 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
732 | 732 | | |
733 | 733 | | |
734 | 734 | | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
735 | 751 | | |
0 commit comments