style: ruff format convo_miner.py (#741)
This commit is contained in:
@@ -108,18 +108,14 @@ def _chunk_by_exchange(lines: list) -> list:
|
|||||||
# First chunk: user turn + as much response as fits
|
# First chunk: user turn + as much response as fits
|
||||||
first_part = content[:CHUNK_SIZE]
|
first_part = content[:CHUNK_SIZE]
|
||||||
if len(first_part.strip()) > MIN_CHUNK_SIZE:
|
if len(first_part.strip()) > MIN_CHUNK_SIZE:
|
||||||
chunks.append(
|
chunks.append({"content": first_part, "chunk_index": len(chunks)})
|
||||||
{"content": first_part, "chunk_index": len(chunks)}
|
|
||||||
)
|
|
||||||
# Remaining response in CHUNK_SIZE-sized continuation drawers
|
# Remaining response in CHUNK_SIZE-sized continuation drawers
|
||||||
remainder = content[CHUNK_SIZE:]
|
remainder = content[CHUNK_SIZE:]
|
||||||
while remainder:
|
while remainder:
|
||||||
part = remainder[:CHUNK_SIZE]
|
part = remainder[:CHUNK_SIZE]
|
||||||
remainder = remainder[CHUNK_SIZE:]
|
remainder = remainder[CHUNK_SIZE:]
|
||||||
if len(part.strip()) > MIN_CHUNK_SIZE:
|
if len(part.strip()) > MIN_CHUNK_SIZE:
|
||||||
chunks.append(
|
chunks.append({"content": part, "chunk_index": len(chunks)})
|
||||||
{"content": part, "chunk_index": len(chunks)}
|
|
||||||
)
|
|
||||||
elif len(content.strip()) > MIN_CHUNK_SIZE:
|
elif len(content.strip()) > MIN_CHUNK_SIZE:
|
||||||
chunks.append(
|
chunks.append(
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user