Refactor text chunking implementation and update configuration

- Moved SentenceTextChunker and SentenceTextChunkerConfig to the utils module for better organization.
- Updated pytest.ini to include the current directory in the Python path.
- Added a new utils module with shared utility helpers.
- Adjusted import paths in the test files to reflect the new location of text chunking classes.
This commit is contained in:
Xin Wang
2026-06-18 10:15:07 +08:00
parent a6777a827b
commit cf0a8b71fd
5 changed files with 5 additions and 3 deletions

View File

@@ -1,3 +1,4 @@
[pytest]
pythonpath = .
markers =
integration: marks tests that need access to external services
integration: marks tests that need access to external services

View File

@@ -7,7 +7,7 @@ from fastgpt_client.exceptions import (
)
from ..core.fastgpt_client import get_fastgpt_client
from ..core.config import Config
from ..voice.text_chunker import SentenceTextChunker, SentenceTextChunkerConfig
from ..utils.text_chunker import SentenceTextChunker, SentenceTextChunkerConfig
from loguru import logger
import json
import re

1
src/utils/__init__.py Normal file
View File

@@ -0,0 +1 @@
"""Shared utility helpers."""

View File

@@ -1,4 +1,4 @@
from src.voice.text_chunker import SentenceTextChunker, SentenceTextChunkerConfig
from src.utils.text_chunker import SentenceTextChunker, SentenceTextChunkerConfig
def test_chinese_sentence_chunks_wait_for_lookahead():