Skip to content

LCORE-1241: better RAGChunk model#1150

Merged
tisnik merged 2 commits into
lightspeed-core:mainfrom
tisnik:lcore-1241-better-ragchunkmodel
Feb 15, 2026
Merged

LCORE-1241: better RAGChunk model#1150
tisnik merged 2 commits into
lightspeed-core:mainfrom
tisnik:lcore-1241-better-ragchunkmodel

Conversation

@tisnik
Copy link
Copy Markdown
Contributor

@tisnik tisnik commented Feb 15, 2026

Description

LCORE-1241: better RAGChunk model

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up service version
  • Bump-up dependent library
  • Bump-up library or tool used for development (does not change the final image)
  • CI configuration change
  • Konflux configuration change
  • Unit tests improvement
  • Integration tests improvement
  • End to end tests improvement
  • Benchmarks improvement

Tools used to create PR

  • Assisted-by: N/A
  • Generated by: N/A

Related Tickets & Documents

  • Related Issue #LCORE-1241

Summary by CodeRabbit

  • Chores
    • Internal code cleanup and formatting adjustments to improve consistency.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 15, 2026

Walkthrough

Two files updated: Pydantic field definitions in RAGChunk clarified to explicitly specify default=None parameter, and test file reformatted by removing trailing pyright ignore comments from constructor calls.

Changes

Cohort / File(s) Summary
Type Definition Clarification
src/utils/types.py
Updated RAGChunk.source and RAGChunk.score field declarations from Field(None, ...) to Field(default=None, ...) for explicit default parameter syntax.
Test Cleanup
tests/unit/models/responses/test_rag_chunk.py
Removed trailing pyright ignore comments from RAGChunk constructor calls and reformatted for conciseness.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'LCORE-1241: better RAGChunk model' is directly related to the main changes in the pull request, which involve improving the RAGChunk model by clarifying Field defaults and removing linter exceptions in tests.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tests/unit/models/responses/test_rag_chunk.py (1)

11-11: ⚠️ Potential issue | 🟡 Minor

Remove the residual pyright: ignore comment on line 11 — it's now unnecessary.

The RAGChunk model has proper Field(default=None, ...) configuration for optional fields (source and score), making the constructor call valid without any ignore directive. Other similar constructor calls on lines 49, 57, and 70 already omit this comment.

-        chunk = RAGChunk(content="Sample content")  # pyright: ignore[reportCallIssue]
+        chunk = RAGChunk(content="Sample content")
🧹 Nitpick comments (1)
src/utils/types.py (1)

169-175: Inconsistency: ReferencedDocument still uses positional None in Field().

RAGChunk was updated to use Field(default=None, ...), but ReferencedDocument.doc_url and ReferencedDocument.doc_title still use the older Field(None, ...) style. Consider updating these for consistency within the same file.

♻️ Suggested fix
     doc_url: Optional[AnyUrl] = Field(
-        None, description="URL of the referenced document"
+        default=None, description="URL of the referenced document"
     )

     doc_title: Optional[str] = Field(
-        None, description="Title of the referenced document"
+        default=None, description="Title of the referenced document"
     )

@tisnik tisnik merged commit 936bece into lightspeed-core:main Feb 15, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant