mirror of
https://github.com/mruwnik/memory.git
synced 2026-01-02 09:12:58 +01:00
proper modality for github items
This commit is contained in:
parent
526bfa5f6b
commit
efbc469ee3
@ -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"]
|
||||
|
||||
@ -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"],
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user