Skip to content

Commit 9c0fc5b

Browse files
committed
chore: ruff format + fix import ordering in types.py
1 parent cbeeb0c commit 9c0fc5b

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

  • hindsight-api-slim/hindsight_api/engine/retain

hindsight-api-slim/hindsight_api/engine/retain/types.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
from content input to fact storage.
66
"""
77

8+
import logging
89
from dataclasses import dataclass, field
910
from datetime import datetime
1011
from typing import Literal, TypedDict
1112
from uuid import UUID
1213

13-
import logging
14-
1514
logger = logging.getLogger(__name__)
1615

1716

@@ -203,13 +202,25 @@ def _is_degenerate_text(text: str) -> bool:
203202
return True
204203
# Single or repeated punctuation patterns with no semantic content
205204
degenerate_patterns = {
206-
"...", "…", "-", "--", "---", ".", "..", "•", "·",
207-
"*", "**", "***", "_,_", "_, _, _",
205+
"...",
206+
"…",
207+
"-",
208+
"--",
209+
"---",
210+
".",
211+
"..",
212+
"•",
213+
"·",
214+
"*",
215+
"**",
216+
"***",
217+
"_,_",
218+
"_, _, _",
208219
}
209220
if stripped in degenerate_patterns:
210221
return True
211222
# Strings composed entirely of punctuation and whitespace
212-
if all(c in '.,;:!?-–—…"\'\t\n\r' for c in stripped):
223+
if all(c in ".,;:!?-–—…\"'`´ \t\n\r" for c in stripped):
213224
return True
214225
# Very short text (<= 2 chars) that is only punctuation
215226
if len(stripped) <= 2 and all(not c.isalnum() for c in stripped):

0 commit comments

Comments
 (0)