fix(cli): Improve cli wrapper and fix init command behavior#1214
fix(cli): Improve cli wrapper and fix init command behavior#1214
Conversation
Signed-off-by: Diwank Singh Tomer <diwank.singh@gmail.com>
WalkthroughThis PR enhances the NLP module by refining keyword extraction functions and introducing a new parameter for improved full-text search capabilities. The CLI has been refactored for better modularity, including new utility functions, a custom prompt style, and template selection support in the Changes
Entelligence.ai can learn from your feedback. Simply add 👍 / 👎 emojis to teach it your preferences. More shortcuts belowEmoji Descriptions:
Interact with the Bot:
|
| keywords = extract_keywords(sent_doc, top_n, split_chunks=split_chunks) | ||
| keywords = [kw for kw in keywords if len(kw) > 1] | ||
| if len(keywords) < min_keywords: | ||
| continue |
There was a problem hiding this comment.
Filtering keywords with len(kw) > 1 after extraction could return fewer keywords than min_keywords, making the minimum check ineffective. Move length check before the minimum check.
📝 Committable Code Suggestion
‼️ Ensure you review the code suggestion before committing it to the branch. Make sure it replaces the highlighted code, contains no missing lines, and has no issues with indentation.
| keywords = extract_keywords(sent_doc, top_n, split_chunks=split_chunks) | |
| keywords = [kw for kw in keywords if len(kw) > 1] | |
| if len(keywords) < min_keywords: | |
| continue | |
| keywords = [kw for kw in extract_keywords(sent_doc, top_n, split_chunks=split_chunks) if len(kw) > 1] | |
| if len(keywords) < min_keywords: | |
| continue |
|
@claude please review |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
|
@claude please review |
|
Claude finished @anasalatasiuni's task —— View job 📋 Code Review for PR #1214I've completed my review of this PR that improves the CLI wrapper and fixes init command behavior. Here's my comprehensive feedback: ✅ Overall AssessmentThe PR enhances the CLI's usability and modularity with template selection support, custom styling, and improved error handling. The refactoring improves code organization and maintainability. 🎯 Key Changes Reviewed1. CLI Improvements ✓
2. Code Quality Issues Found🔧 Issue 1: Keyword Filtering Logic (agents-api/agents_api/common/nlp.py:154-156)The existing review comment is valid. The current implementation filters keywords by length > 1 AFTER extraction, which could result in fewer keywords than keywords = extract_keywords(sent_doc, top_n, split_chunks=split_chunks)
keywords = [kw for kw in keywords if len(kw) > 1] # This happens after extraction
if len(keywords) < min_keywords:
continueRecommendation: Move the length check inside
|
EntelligenceAI PR Summary
Purpose:
Changes:
initcommand.Impact: