-
Notifications
You must be signed in to change notification settings - Fork 4
fix: large system message in Xpert Assistant #213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
1498819
fix: large system message in Xpert Assistant
naincy128 be78155
fix: update test proportional logic
naincy128 411ed66
fix: modification in the flow
naincy128 bc5f38d
fix: update in total length calculation
naincy128 c37a5a5
feat: use getattr for unit_content_max_length
naincy128 8598c77
fix: content length limit exceeded after formatting
naincy128 0f3d9f0
chore: refine content trimming, empty content handling, and tests
naincy128 3caaa4e
chore: changelog and init update for Xpert Assistant fix
naincy128 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -197,13 +197,34 @@ def test_get_block_content(self, mock_get_children_contents, mock_get_single_blo | |||||||||||||||||||||||||||||||||||||||||
| self.assertEqual(items, content_items) | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| @ddt.data( | ||||||||||||||||||||||||||||||||||||||||||
| 'This is content.', | ||||||||||||||||||||||||||||||||||||||||||
| '' | ||||||||||||||||||||||||||||||||||||||||||
| 'This is content.', # Short string case | ||||||||||||||||||||||||||||||||||||||||||
| '', # Empty string case | ||||||||||||||||||||||||||||||||||||||||||
| 'A' * 200, # Long string case to test trimming | ||||||||||||||||||||||||||||||||||||||||||
| [ # VIDEO content case | ||||||||||||||||||||||||||||||||||||||||||
| {'content_type': 'VIDEO', 'content_text': f"Video transcript {i} " + ("A" * 200)} for i in range(10) | ||||||||||||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||||||||||||
| [ # TEXT content case | ||||||||||||||||||||||||||||||||||||||||||
| {'content_type': 'TEXT', 'content_text': f"Paragraph {i} " + ("B" * 100)} for i in range(20) | ||||||||||||||||||||||||||||||||||||||||||
| ], | ||||||||||||||||||||||||||||||||||||||||||
| [ # Mixed VIDEO + TEXT case | ||||||||||||||||||||||||||||||||||||||||||
| {'content_type': 'VIDEO', 'content_text': "Video intro " + ("C" * 100)}, | ||||||||||||||||||||||||||||||||||||||||||
| {'content_type': 'TEXT', 'content_text': "Some explanation " + ("D" * 100)}, | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+202
to
+211
|
||||||||||||||||||||||||||||||||||||||||||
| 'A' * 200, # Long string case to test trimming | |
| [ # VIDEO content case | |
| {'content_type': 'VIDEO', 'content_text': f"Video transcript {i} " + ("A" * 200)} for i in range(10) | |
| ], | |
| [ # TEXT content case | |
| {'content_type': 'TEXT', 'content_text': f"Paragraph {i} " + ("B" * 100)} for i in range(20) | |
| ], | |
| [ # Mixed VIDEO + TEXT case | |
| {'content_type': 'VIDEO', 'content_text': "Video intro " + ("C" * 100)}, | |
| {'content_type': 'TEXT', 'content_text': "Some explanation " + ("D" * 100)}, | |
| 'A' * 20, # Long string case to test trimming (reduced size) | |
| [ # VIDEO content case | |
| {'content_type': 'VIDEO', 'content_text': f"Video transcript {i} " + ("A" * 20)} for i in range(10) | |
| ], | |
| [ # TEXT content case | |
| {'content_type': 'TEXT', 'content_text': f"Paragraph {i} " + ("B" * 10)} for i in range(20) | |
| ], | |
| [ # Mixed VIDEO + TEXT case | |
| {'content_type': 'VIDEO', 'content_text': "Video intro " + ("C" * 10)}, | |
| {'content_type': 'TEXT', 'content_text': "Some explanation " + ("D" * 10)}, |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Division by zero is possible if
total_charsis 0. Although there's a check at line 159, this code could still execute iftotal_charsbecomes 0 through other paths.