Repository navigation
Return concatinated result when streaming is enabled - #1276
Conversation
Resolves receptron#1275. Signed-off-by: Masashi Honma <[email protected]>
📝 WalkthroughWalkthroughThe change adds a new Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Tip 🧪 Unit Test Generation v2 is now available!We have significantly improved our unit test generation capabilities. To enable: Add this to your reviews:
finishing_touches:
unit_tests:
enabled: trueTry it out by using the Have feedback? Share your thoughts on our Discord thread! Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@llm_agents/gemini_agent/lib/gemini_agent.js`:
- Around line 173-175: The code assigns chunk.text to chunkText and concatenates
it into concatinatedText without guarding against undefined, which can insert
the literal "undefined"; update the logic in gemini_agent.js around the
variables chunkText, finalResponse, and concatinatedText to treat missing text
as an empty string (e.g., set chunkText = chunk.text ?? '' or check typeof
chunk.text === 'string' before concatenation) and only set finalResponse when
appropriate, so undefined chunk.text values are ignored and not concatenated.
In `@llm_agents/gemini_agent/src/gemini_agent.ts`:
- Around line 242-244: The code assigns chunk to finalResponse and appends
chunk.text to concatinatedText without guarding for undefined, causing the
literal "undefined" to appear; update the logic around chunk, chunkText,
finalResponse and concatinatedText so you normalize chunkText to an empty string
when chunk.text is undefined (e.g., use chunk.text ?? '' or a typeof check) and
only append the normalized value to concatinatedText; keep the finalResponse =
chunk assignment as-is if needed but ensure concatenation uses the safe
chunkText variable.
🧹 Nitpick comments (2)
llm_agents/gemini_agent/src/gemini_agent.ts (2)
57-64: Typo in parameter name:concatinatedText→concatenatedText.The variable name has a spelling error ("concatinated" instead of "concatenated"). While functional, this affects code readability and searchability.
235-235: Add missing semicolons for consistency.Lines 235 and 244 are missing semicolons, which is inconsistent with the rest of the file that uses them consistently.
Proposed fix
- let concatinatedText = '' + let concatinatedText = '';- concatinatedText += chunkText + concatinatedText += chunkText;Also applies to: 244-244
Signed-off-by: Masashi Honma <[email protected]>
|
Please fix the typo that coderabbitai pointed out: |
Signed-off-by: Masashi Honma <[email protected]>
|
@isamu Thank you for comment. Fixed. |
|
Thank you for your pull request!! |
Resolves #1275.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.