mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 21:19:12 +00:00
- Start standardizing implementation of the `text_to_jsonl' processors
- `text_to_jsonl; scripts already had a shared structure
- This change starts to codify that implicit structure
- Benefits
- Ease adding more `text_to_jsonl; processors
- Allow merging shared functionality
- Help with type hinting
- Drawbacks
- Lower agility to change. But this was already an implicit issue as
the text_to_jsonl processors got more deeply wired into the app
15 lines
386 B
Python
15 lines
386 B
Python
# Standard Packages
|
|
from abc import ABC, abstractmethod
|
|
from typing import Iterable
|
|
|
|
# Internal Packages
|
|
from src.utils.rawconfig import TextContentConfig
|
|
|
|
|
|
class TextToJsonl(ABC):
|
|
def __init__(self, config: TextContentConfig):
|
|
self.config = config
|
|
|
|
@abstractmethod
|
|
def process(self, previous_entries: Iterable[tuple[int, dict]]=None) -> list[tuple[int, dict]]: ...
|