-
-
Notifications
You must be signed in to change notification settings - Fork 274
Created chunks for committee related data #1723
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
Conversation
Summary by CodeRabbit
WalkthroughA new Django management command, Changes
Assessment against linked issues
Assessment against linked issues: Out-of-scope changesNo out-of-scope changes found. Possibly related PRs
Suggested labels
Suggested reviewers
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
Actionable comments posted: 4
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
backend/apps/ai/Makefile(1 hunks)backend/apps/ai/management/commands/ai_create_committee_chunks.py(1 hunks)
🔇 Additional comments (5)
backend/apps/ai/Makefile (1)
5-7: LGTM! Consistent with existing patterns.The new Makefile target follows the same pattern as existing AI chunk creation targets, maintaining consistency in the codebase.
backend/apps/ai/management/commands/ai_create_committee_chunks.py (4)
66-66: Chunk.bulk_save method confirmed
Thebulk_savemethod exists in theChunkmodel atbackend/apps/ai/models/chunk.py(around lines 40–42) and delegates toBulkSaveModel.bulk_save. No further action is needed.
81-81: Chunk.split_text method implementation foundThe
split_textmethod is defined inbackend/apps/ai/models/chunk.pyat line 45:
def split_text(text: str) -> list[str]:No further action is needed.
36-36: Walrus operator usage is safe: project requires Python ≥3.13The backend’s pyproject.toml specifies
python = "^3.13"which ensures Python 3.13 (and thus ≥3.8) is used. The walrus operator at lines 36, 44, and 51 is fully supported—no change needed.
87-91: Confirmed:create_chunks_and_embeddingsis implemented with error handling
The function is defined inbackend/apps/ai/common/utils.py(lines 16–64) and wraps the OpenAI call in atry/except Exceptionblock, logging any errors and returning an empty list on failure. No further changes needed.
|



Resolves #1719