proper modality for github items

This commit is contained in:
mruwnik 2025-12-23 22:13:11 +00:00
parent 526bfa5f6b
commit efbc469ee3
2 changed files with 8 additions and 1 deletions

View File

@ -894,6 +894,13 @@ class GithubItem(SourceItem):
merged_at=cast(datetime | None, self.merged_at),
)
def _chunk_contents(self) -> Sequence[extract.DataChunk]:
"""Override to use 'github' modality instead of default 'text'."""
content = cast(str | None, self.content)
if content:
return extract.extract_text(content, modality="github")
return []
class NotePayload(SourceItemPayload):
note_type: Annotated[str | None, "Category of the note"]

View File

@ -58,7 +58,7 @@ def _create_github_item(
repo_tags = cast(list[str], repo.tags) or []
return GithubItem(
modality="text",
modality="github",
sha256=create_content_hash(content),
content=content,
kind=issue_data["kind"],