Skip to content

Commit

Permalink
Rename ChunkOverlapTask -> ChunkOverlap
Browse files Browse the repository at this point in the history
  • Loading branch information
volkerstampa committed Feb 29, 2024
1 parent f96c738 commit 501589a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/intelligence_layer/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from .chunk import Chunk as Chunk
from .chunk import ChunkInput as ChunkInput
from .chunk import ChunkOutput as ChunkOutput
from .chunk import ChunkOverlapTask as ChunkOverlapTask
from .chunk import ChunkOverlap as ChunkOverlap
from .chunk import TextChunk as TextChunk
from .detect_language import DetectLanguage as DetectLanguage
from .detect_language import DetectLanguageInput as DetectLanguageInput
Expand Down
2 changes: 1 addition & 1 deletion src/intelligence_layer/core/chunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def do_run(self, input: ChunkInput, task_span: TaskSpan) -> ChunkOutput:
return ChunkOutput(chunks=chunks)


class ChunkOverlapTask(Task[ChunkInput, ChunkOutput]):
class ChunkOverlap(Task[ChunkInput, ChunkOutput]):
"""Splits a longer text into smaller text chunks, where every chunk overlaps
with the previous chunk by `overlap_length_tokens` number of tokens.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Mapping

from intelligence_layer.core import Chunk, ChunkInput, Task, TaskSpan
from intelligence_layer.core.chunk import ChunkOutput, ChunkOverlapTask
from intelligence_layer.core.chunk import ChunkOutput, ChunkOverlap
from intelligence_layer.core.detect_language import Language
from intelligence_layer.core.model import ControlModel, LuminousControlModel
from intelligence_layer.use_cases.summarize.steerable_single_chunk_summarize import (
Expand Down Expand Up @@ -52,7 +52,7 @@ def __init__(
if overlap_length_tokens == 0:
self._chunk_task = Chunk(model, max_tokens_per_chunk)
else:
self._chunk_task = ChunkOverlapTask(
self._chunk_task = ChunkOverlap(
model,
max_tokens_per_chunk,
overlap_length_tokens,
Expand Down
4 changes: 2 additions & 2 deletions tests/core/test_chunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from intelligence_layer.core import (
ChunkInput,
ChunkOverlapTask,
ChunkOverlap,
InMemoryTracer,
LuminousControlModel,
)
Expand All @@ -24,7 +24,7 @@ def test_overlapped_chunking(
MAX_TOKENS = 16

tracer = InMemoryTracer()
task = ChunkOverlapTask(
task = ChunkOverlap(
model=luminous_control_model,
max_tokens_per_chunk=MAX_TOKENS,
overlap_length_tokens=OVERLAP,
Expand Down

0 comments on commit 501589a

Please sign in to comment.